Пример #1
0
 public static void Serialize <T>(Session session, MemoryStream destination, T packet) where T : Packet
 {
     byte[] idBytes = ConvertHelper.GetBytes(packet.GetPacketId());
     destination.Write(idBytes, 0, idBytes.Length);
     packet.Serialize(destination);
     ProtoHelper.ReturnPacket(packet);
 }
Пример #2
0
 private void OnReceive(Session session, Packet packet)
 {
     packet.Process();
     ProtoHelper.ReturnPacket(packet);
 }