Exemplo n.º 1
0
    /// <summary>
    /// 如果战斗还在继续,则需要向网络发起请求,告知服务器客户端失败
    /// </summary>
    void SettleBossBattle()
    {
        bool WarIsOnGoing = BanBattleManager.Instance.War.WarIsOnGoing;

        TemporyData temp = Core.Data.temper;

        temp.GiveUpBattle = true;

        if (WarIsOnGoing)
        {
            ClientBattleCheckParam param   = null;
            RequestType            ReqType = RequestType.SETTLE_BOSSBATTLE;

            HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Igonre_Response);
            if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
            {
                param = new ClientBattleCheckParam(temp.clientReqParam, null, null, string.Empty, null, null);
            }
            else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu ||
                     temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
            {
                param   = new ClientBTShaBuParam(temp.shaluBuOuParam, null, null, string.Empty, null, null);
                ReqType = RequestType.SETTLE_SHABU;
            }

            param.sequence.LeftWin = 0;
            task.AppendCommonParam(ReqType, param);

            //then you should dispatch to a real handler
            task.DispatchToRealHandler();
        }
    }
Exemplo n.º 2
0
        /// <summary>
        /// 在UI层的EndOfWar来发起网络请求
        /// </summary>
        public void SettleBattle()
        {
            ///加入数据的统计,将统计的结果通知给服务器
            TemporyData temp = Core.Data.temper;

            HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response);

            int[] killArr = getMaxDeadArray.kill_array;
            statictis.anaylizeHp(_attTeam);
            int             star    = statictis.getRank(WarIsOver);
            MaxKillOfWhoDid MaxRole = getMaxDeadArray.role;

            Statistic any = new Statistic()
            {
                skillcount      = getTotalNormalSkill,
                skillcountratio = getAverageNoramlSkill,
                maxkill         = getMaxAttackTeamKillCount,
                enemyDieIndex   = getEnemyDieIndex,
                star            = star,
            };
            StaticsticList full = new StaticsticList()
            {
                skillarr = getNormalSkillIDs,
                killarry = killArr,
                role     = MaxRole,
            };

            ComboGather combo = new ComboGather()
            {
                btnMax      = temp.MaxCombo,
                btnTotal    = temp.TotalCombo,
                fingerMax   = temp.FingerMaxCombo,
                fingerTotal = temp.FingerTotalCombo,
            };

            ClientBattleCheckParam param   = null;
            RequestType            ReqType = RequestType.SETTLE_BOSSBATTLE;

            if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
            {
                param = new ClientBattleCheckParam(temp.clientReqParam, any, full, generateVideo(), generateVideoParse(), combo);
            }
            else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu ||
                     temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
            {
                param   = new ClientBTShaBuParam(temp.shaluBuOuParam, any, full, generateVideo(), generateVideoParse(), combo);
                ReqType = RequestType.SETTLE_SHABU;
            }
            else
            {
                ConsoleEx.DebugLog("TemporyData CurrentBattleType = " + temp.currentBattleType, ConsoleEx.RED);
            }

            temp.LetGoACT = HttpRequestFactory.ACTION_SETTLE_BATTLE_BOSS;

            param.sequence.LeftWin = WarIsOver;
            task.AppendCommonParam(ReqType, param);

            task.ErrorOccured   = HttpResp_Error;
            task.afterCompleted = Http_Suc;

            //then you should dispatch to a real handler

            if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu ||
                temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
            {
                if (!m_ShabuReplay)
                {
                    task.DispatchToRealHandler();
                    m_ShabuReplay = true;
                }
            }
            else
            {
                task.DispatchToRealHandler();
            }


            cachedTask = task;
            temp.warBattle.battleData.iswin = WarIsOver == 0 ? 2 : 1;

            SettleInLocal();
        }