mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 03:40:46 +00:00
31 lines
611 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
} |