2020-12-16 09:08:38 +00:00
|
|
|
|
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)
|
2020-12-16 09:08:38 +00:00
|
|
|
|
{
|
|
|
|
|
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();
|
2020-12-20 23:50:24 +00:00
|
|
|
|
msgSize = msgData?.Length ?? 0;
|
2020-12-04 09:23:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-04 09:29:23 +00:00
|
|
|
|
}
|