public static ChatPacket Parse(string str)
    {
        ChatPacket chatPacket = new ChatPacket();

        chatPacket.header = ChatPacketHeader.Parse(str);
        chatPacket.model  = ParseModel(str, chatPacket.packetType);
        return(chatPacket);
    }
Beispiel #2
0
    public int Send(Chat_Model_Base model, Type type, int to_id, bool promise = true, Func <Coop_Model_ACK, bool> onReceiveAck = null, Func <Coop_Model_Base, bool> onPreResend = null)
    {
        int              result            = 0;
        ChatPacket       chatPacket        = new ChatPacket();
        ChatPacketHeader chatPacketHeader2 = chatPacket.header = new ChatPacketHeader(0, model.commandId, fromId);

        chatPacket.model = model;
        PacketStream stream = chatPacket.Serialize();

        if (model.commandId == 502)
        {
            goto IL_0040;
        }
        goto IL_0040;
IL_0040:
        NativeSend(stream);
        return(result);
    }