public static void Send(Cmd.CLIENTID msgid) { if (!isConnected) { return; } SendCommand(Frame.Packet.ToPacket((int)msgid)); //LogClass.Instance.LogSend(sendcmd); }
public static void Send <T>(Cmd.CLIENTID msgid, T protodata) where T : ProtoBuf.IExtensible { if (!isConnected) { return; } MemoryStream stream = new MemoryStream(); ProtoBuf.Serializer.Serialize <T>(stream, protodata); Frame.Packet packet = Frame.Packet.ToPacket((int)msgid, stream.ToArray()); SendCommand(packet); }