mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
25 lines
541 B
C#
25 lines
541 B
C#
using System;
|
|
|
|
namespace QuantumUNET.Messages
|
|
{
|
|
public class QSBNetworkMessage
|
|
{
|
|
public const int MaxMessageSize = 65535;
|
|
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);
|
|
}
|
|
}
|
|
} |