quantum-space-buddies/QuantumUNET/Messages/QSBNetworkMessage.cs
Mister_Nebula 7a4149bee6 Revert "REVERT"
This reverts commit 661c04a987.
2020-12-16 09:08:38 +00:00

23 lines
522 B
C#

using QuantumUNET.Transport;
using System;
namespace QuantumUNET.Messages
{
public class QSBNetworkMessage
{
public short MsgType;
public QSBNetworkConnection Connection;
public QSBNetworkReader Reader;
public int ChannelId;
public TMsg ReadMessage<TMsg>() where TMsg : QSBMessageBase, new()
{
var result = Activator.CreateInstance<TMsg>();
result.Deserialize(Reader);
return result;
}
public void ReadMessage<TMsg>(TMsg msg) where TMsg : QSBMessageBase =>
msg.Deserialize(Reader);
}
}