quantum-space-buddies/QuantumUNET/Messages/QSBAddPlayerMessage.cs
Mister_Nebula 9f4d886903 more
2020-12-15 16:37:52 +00:00

31 lines
611 B
C#

using QuantumUNET.Transport;
namespace QuantumUNET.Messages
{
internal class QSBAddPlayerMessage : QSBMessageBase
{
public short playerControllerId;
public int msgSize;
public byte[] msgData;
public override void Serialize(QSBNetworkWriter writer)
{
writer.Write(playerControllerId);
writer.WriteBytesAndSize(msgData, msgSize);
}
public override void Deserialize(QSBNetworkReader reader)
{
playerControllerId = reader.ReadInt16();
msgData = reader.ReadBytesAndSize();
if (msgData == null)
{
msgSize = 0;
}
else
{
msgSize = msgData.Length;
}
}
}
}