예제 #1
0
        /// <summary>
        /// 客户端请求
        /// </summary>
        /// <param name="operationRequest"></param>
        /// <param name="sendParameters"></param>
        protected override void OnOperationRequest(OperationRequest request, SendParameters sendParameters)
        {
            MobaApplication.LogInfo(request.ToString());
            byte opCode  = request.OperationCode;
            byte SubCode = (byte)request[80];

            switch (opCode)
            {
            case OpCode.AccountCode:
                Account.OnRequest(this, SubCode, request);
                break;

            case OpCode.PlayerCode:
                Player.OnRequest(this, SubCode, request);
                break;

            case OpCode.SelectCode:
                Select.OnRequest(this, SubCode, request);
                break;

            case OpCode.FightCode:
                Fight.OnRequest(this, SubCode, request);
                break;

            default:
                break;
            }
        }
예제 #2
0
        /// <summary>
        /// 客户端发起请求
        /// </summary>
        /// <param name="operationRequest"></param>
        /// <param name="sendParameters"></param>
        protected override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            MobaApplication.LogInfo((account.cache == player.accountCache) + "是否相同");
            byte opCode  = operationRequest.OperationCode;
            byte subCode = (byte)operationRequest[80];

            switch (opCode)
            {
            case OpCode.AccountCode:
                account.OnRequest(this, subCode, operationRequest);
                break;

            case OpCode.PlayerCode:
                player.OnRequest(this, subCode, operationRequest);
                break;

            case OpCode.SelectCode:
                select.OnRequest(this, subCode, operationRequest);
                break;

            case OpCode.FightCode:
                fight.OnRequest(this, subCode, operationRequest);
                break;

            default:
                break;
            }
        }