mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-28 14:53:55 +00:00
31 lines
635 B
C#
31 lines
635 B
C#
namespace QuantumUNET
|
|
{
|
|
internal class QSBAddPlayerMessage : QSBMessageBase
|
|
{
|
|
public override void Deserialize(QSBNetworkReader reader)
|
|
{
|
|
this.playerControllerId = (short)reader.ReadUInt16();
|
|
this.msgData = reader.ReadBytesAndSize();
|
|
if (this.msgData == null)
|
|
{
|
|
this.msgSize = 0;
|
|
}
|
|
else
|
|
{
|
|
this.msgSize = this.msgData.Length;
|
|
}
|
|
}
|
|
|
|
public override void Serialize(QSBNetworkWriter writer)
|
|
{
|
|
writer.Write((ushort)this.playerControllerId);
|
|
writer.WriteBytesAndSize(this.msgData, this.msgSize);
|
|
}
|
|
|
|
public short playerControllerId;
|
|
|
|
public int msgSize;
|
|
|
|
public byte[] msgData;
|
|
}
|
|
} |