Exemplo n.º 1
0
        public void OnReceive(ClientPeer client, MessageData message)
        {
            switch (message.OpCode)
            {
            case OpCode.ACCOUNT:
                account.OnReceive(client, message.SubCode, message.Value);
                break;

            case OpCode.USER:
                user.OnReceive(client, message.SubCode, message.Value);
                break;

            case OpCode.MATCHROOM:
                match.OnReceive(client, message.SubCode, message.Value);
                break;

            case OpCode.CHAT:
                chat.OnReceive(client, message.SubCode, message.Value);
                break;

            case OpCode.FIGHT:
                fight.OnReceive(client, message.SubCode, message.Value);
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        public void OnReceive(ClientPeer client, SocketMsg msg)
        {
            switch (msg.opCode)
            {
            case OpCode.ACCOUNT:
                account.OnReceive(client, msg.subCode, msg.value);
                break;

            case OpCode.USER:
                user.OnReceive(client, msg.subCode, msg.value);
                break;

            case OpCode.MATCH:
                match.OnReceive(client, msg.subCode, msg.value);
                break;

            case OpCode.CHAT:
                chat.OnReceive(client, msg.subCode, msg.value);
                break;

            case OpCode.FIGHT:
                fight.OnReceive(client, msg.subCode, msg.value);
                break;
            }
        }
Exemplo n.º 3
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;
        }
    }
Exemplo n.º 4
0
    /// <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;
        }
    }
Exemplo n.º 5
0
        public void OnReceive(ClientPeer client, SocketMsg msg)
        {
            switch (msg.OpCode)
            {
            case MsgType.Account:
                loginServer.OnReceive(client, msg); break;

            case MsgType.User:
                userServer.OnReceive(client, msg); break;

            case MsgType.Match:
                matchServer.OnReceive(client, msg); break;

            case MsgType.Chat:
                chatServer.OnReceive(client, msg); break;

            case MsgType.Fight:
                fightServer.OnReceive(client, msg); break;
            }
        }
Exemplo n.º 6
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;
        }
    }
Exemplo n.º 7
0
        public void OnReceive(ClientPeer client, SocketMsg msg)
        {
            switch (msg.OpCode)
            {
            case OpCode.ACCOUNT:
                account.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode.USER:
                user.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode.MATCH:
                match.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode.CHAT:
                chat.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode.FIGHT:
                fight.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode._21Single:
                single.OnReceive(client, msg.SubCode, msg.Value);
                break;

            case OpCode._21Multi:
                multi.OnReceive(client, msg.SubCode, msg.Value);
                break;

            default:
                break;
            }
        }