示例#1
0
文件: Nets.cs 项目: nnoldman/FFF
 public static void SendBuffer(int msgid, byte[] data)
 {
     if (!isConnected)
     {
         return;
     }
     Frame.Packet packet = Frame.Packet.ToPacket(msgid, data);
     SendCommand(packet);
 }
示例#2
0
文件: Nets.cs 项目: nnoldman/FFF
 public static void send(Frame.Packet cmd)
 {
     if (!isConnected)
     {
         return;
     }
     sSerializeBuffer.SetPosition(0);
     cmd.Serialize(sSerializeBuffer);
     Instance.mSocketBase.Send(sSerializeBuffer);
 }
示例#3
0
文件: Nets.cs 项目: nnoldman/FFF
    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);
    }
示例#4
0
文件: Nets.cs 项目: nnoldman/FFF
    public static void SendCommand(int msgid)
    {
        if (!isConnected)
        {
            return;
        }

        if (!isConnected)
        {
            return;
        }
        Frame.Packet packet = Frame.Packet.ToPacket(msgid, null);
        SendCommand(packet);
    }