Add BytesMessage (#214)

This commit is contained in:
MichalPetryka 2019-01-02 17:02:39 +01:00 committed by vis2k
parent a0e763bd38
commit 3ce7eb9915

View File

@ -41,6 +41,30 @@ public override void Serialize(NetworkWriter writer)
} }
} }
public class BytesMessage : MessageBase
{
public byte[] value;
public BytesMessage()
{
}
public BytesMessage(byte[] v)
{
value = v;
}
public override void Deserialize(NetworkReader reader)
{
value = reader.ReadBytesAndSize();
}
public override void Serialize(NetworkWriter writer)
{
writer.WriteBytesAndSize(value);
}
}
public class IntegerMessage : MessageBase public class IntegerMessage : MessageBase
{ {
public int value; public int value;