Exemple #1
0
 public static void Send(Cmd.CLIENTID msgid)
 {
     if (!isConnected)
     {
         return;
     }
     SendCommand(Frame.Packet.ToPacket((int)msgid));
     //LogClass.Instance.LogSend(sendcmd);
 }
Exemple #2
0
    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);
    }