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); }
private void OnReceive(Session session, Packet packet) { packet.Process(); ProtoHelper.ReturnPacket(packet); }