Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Deserialize(byte[] buffer)
- {
- var myPacket = new byte[buffer.Length - 8];
- for (int i = 0; i < myPacket.Length; i++)
- {
- myPacket[i] = buffer[i];
- }
- using (var memoryStream = new System.IO.MemoryStream(myPacket))
- {
- Info = Serializer.DeserializeWithLengthPrefix<MsgActionProto>(memoryStream, PrefixStyle.Fixed32);
- }
- ID = Info.ID;
- UID = Info.UID;
- TimeStamp = new Time32(Info.TimeStamp);
- NpcID = Info.NpcID;
- Facing = Info.Facing;
- PositionX = Info.PositionX;
- }
- public byte[] ToArray()
- {
- Info = new DataProto()
- {
- ID = ID, UID = UID, Facing = Facing,
- TimeStamp = (uint)TimeStamp.Value,
- PositionX = PositionX,
- };
- return Kernel.FinalizeProtoBuf(Info, 10010);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement