コード例 #1
0
    /// <summary>
    /// 处理服务器发来的消息
    /// </summary>
    /// <param name="msg"></param>
    private void ProcessServerSendMsg(NetMsg msg)
    {
        //Debug.Log("NetMsgCenter - 处理服务器发来的消息");
        switch (msg.opCode)
        {
        case OpCode.Account:
            accountHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Match:
            matchHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Chat:
            chatHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Fight:
            fightHandler.OnReceive(msg.subCode, msg.value);
            break;

        default:
            break;
        }
    }
コード例 #2
0
ファイル: NetMsgCenter.cs プロジェクト: loneys/ZJHGameClient
    /// <summary>
    /// 处理服务器发来的消息
    /// </summary>
    /// <param name="msg"></param>
    private void ProcessServerSendMsg(NetMsg msg)
    {
        Debug.Log("--wangzhi--接收消息--" + msg.opCode + "  " + msg.subCode + "   " + msg.value);
        switch (msg.opCode)
        {
        case OpCode.Account:
            accountHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Match:
            matchHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Chat:
            chatHandler.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Fight:
            fightHandler.OnReceive(msg.subCode, msg.value);
            break;

        default:
            break;
        }
    }
コード例 #3
0
    /// <summary>
    /// 处理服务器发来的消息
    /// </summary>
    /// <param name="msg"></param>
    private void ProcessServerSendMsg(NetMsg msg)
    {
        switch (msg.opCode)
        {
        case OpCode.Account:
            accountHander.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Chat:
            matchHander.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Match:
            chatHander.OnReceive(msg.subCode, msg.value);
            break;

        case OpCode.Fight:
            fightHander.OnReceive(msg.subCode, msg.value);
            break;

        default:
            break;
        }
    }