quantum-space-buddies/QuantumUNET/Messages/QAddPlayerMessage.cs

24 lines
539 B
C#
Raw Normal View History

using QuantumUNET.Transport;
namespace QuantumUNET.Messages
2020-12-04 09:23:27 +00:00
{
2020-12-23 12:58:45 +00:00
internal class QAddPlayerMessage : QMessageBase
2020-12-04 09:23:27 +00:00
{
2020-12-07 19:37:21 +00:00
public short playerControllerId;
public int msgSize;
public byte[] msgData;
2020-12-23 12:58:45 +00:00
public override void Serialize(QNetworkWriter writer)
{
writer.Write(playerControllerId);
writer.WriteBytesAndSize(msgData, msgSize);
}
2020-12-23 12:58:45 +00:00
public override void Deserialize(QNetworkReader reader)
2020-12-04 09:23:27 +00:00
{
2020-12-07 19:37:21 +00:00
playerControllerId = reader.ReadInt16();
msgData = reader.ReadBytesAndSize();
msgSize = msgData?.Length ?? 0;
2020-12-04 09:23:27 +00:00
}
}
2020-12-04 09:29:23 +00:00
}