Exemple #1
0
    void Action_123(LanSocket.ClientMsgUnPack msg)
    {
        long   userID     = msg.GetUserID();
        ushort accountLen = msg.ReadUShort();
        string account    = msg.ReadString(accountLen);
        ushort passLen    = msg.ReadUShort();
        string pass       = msg.ReadString(passLen);

        print("Action_123 account: " + account + " pass word: " + pass + " from user: "******"test account";

        sendMsg.Pack16bit((ushort)strAccount.Length);
        sendMsg.PackString(strAccount, (ushort)strAccount.Length);
        string strPass = "******";

        sendMsg.Pack16bit((ushort)strPass.Length);
        sendMsg.PackString(strPass, (ushort)strPass.Length);
        sendMsg.PackEnd();
        m_GameNet.SendTo(ref sendMsg, msg.GetUserID());
    }
Exemple #2
0
    void Action_C2S_ASK_SEND_AUDIO(LanSocket.ClientMsgUnPack msg)
    {
        long   userID  = msg.GetUserID();
        ushort dataLen = msg.ReadUShort();

        byte[] audioData = msg.ReadByte(dataLen);

        //         string result = string.Empty;
        //         for (int i = 0; i < dataLen; i++)
        //         {
        //             result += System.Convert.ToString(audioData[i], 16) + " ";
        //         }
        //         print(result);

        System.Buffer.BlockCopy(audioData, 0, m_AudioData, m_AudioOffset, (int)dataLen);
        m_AudioOffset += dataLen;
    }