Beispiel #1
0
        public void Send <T>(T packet) where T : IDataSerializer
        {
            var info = Proto.GetInfo <T>();

            if (info == null)
            {
                throw new NullReferenceException("Unknwon packet");
            }
            Send(info.Id, packet);
        }
Beispiel #2
0
        public Packet GetPacket <T>(T packet, DataStream stream) where T : IDataSerializer
        {
            var info = Proto.GetInfo <T>();

            if (info == null)
            {
                throw new NullReferenceException("Unknwon packet");
            }
            return(GetPacket(info.Id, stream, packet));
        }