- Download and include in project

- Make sure you strip the 4 bytes at the beginning of the packet (Size and Type) and ensure that you remove the packet footer (8 bytes containing the TQServer/ TQClient) before deserializing your packet. And obviously ensure you add the correct packet headers and footers when sending the serialized packets back to the client
[6132] Walk Packet Class Structure
Code:
[ProtoContract]
public class Packet_Movement
{
[ProtoMember(1)]
public uint Direction { get; set; }
[ProtoMember(2)]
public uint UID { get; set; }
[ProtoMember(3)]
public uint Running { get; set; }
[ProtoMember(4)]
public uint TimeStamp { get; set; }
[ProtoMember(5)]
public uint MapID { get; set; }
}
Protobuff .Net Deserialization Example
Code:
Serializer.Deserialize<Packet_Movement>(new MemoryStream(Packet));
Protobuff .Net Serialization Example
This also converts it from a MemoryStream into a Byte array
Code:
Packet_Movement PM_Class = new Packet_Movement();
byte[] Packet_Data;
using (var ms = new MemoryStream())
{
Serializer.Serialize(ms, PM_Class);
Packet_Data = ms.ToArray();
}






