Example #1
0
        void MsgRecvCallBack(SocketModel model)
        {
            //一级协议模块分发
            switch (model.type)
            {
            //登录模块
            case TypeProtocol.Login:
                LoginHandler.MessageReceive(model);
                break;

            //用户模块
            case TypeProtocol.User:
                UserHandler.MessageReceive(model);
                break;

            //匹配模块
            case TypeProtocol.Match:
                MatchHandler.MessageReceive(model);
                break;;

            case TypeProtocol.Alive:
                AliveHandler.MessageReceive(model);
                break;;
            }
        }
Example #2
0
    /// <summary>
    /// 消息到达回调函数
    /// 进行服务器消息分发
    /// </summary>
    void MessageReceiveCallBack(SocketModel Model)
    {
        //一级协议,大的模块分发
        switch (Model.type)
        {
        //登录模块
        case TypeProtocol.ACCOUNT:
            LoginHandler.MessageReceive(Model);
            break;

        case TypeProtocol.USER:
            UserHandler.MessageReceive(Model);
            break;

        case TypeProtocol.MATCH:
            MatchHandler.MessageReceive(Model);
            break;

        case TypeProtocol.FIGHT:
            FightHandler.MessageReceive(Model);
            break;
        }
    }