예제 #1
0
파일: Session.cs 프로젝트: nikes/Link
        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);
        }
예제 #2
0
파일: Session.cs 프로젝트: nikes/Link
        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));
        }