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); }
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)); }