Explorar o código

通关最大关卡id

cyzhao hai 1 ano
pai
achega
ff8ce7ce11

+ 16 - 1
Gameserver/App/model/User/Info_Gates.php

@@ -203,7 +203,7 @@ class Info_Gates extends Object_ext {
     /**
      * 最大通关id
      */
-    public function maxPassGateId() {
+    public function maxPassGateNumId() {
         $maxIndex = 0;
         //$maxGateId = 0;
         foreach ($this->GateList as $gateId => $Ins_GateInfo) {
@@ -214,4 +214,19 @@ class Info_Gates extends Object_ext {
         }
         return $maxIndex;
     }
+    
+    /**
+     * 最大通关id
+     */
+    public function maxPassGateId() {
+        $maxIndex = 0;
+        $maxGateId = 0;
+        foreach ($this->GateList as $gateId => $Ins_GateInfo) {
+            if ($Ins_GateInfo->pass > 0 && Ins_GateInfo::gateNum($gateId) > $maxIndex) {
+                $maxIndex = Ins_GateInfo::gateNum($gateId);
+                $maxGateId = $gateId;
+            }
+        }
+        return $maxGateId;
+    }
 }

+ 3 - 3
Gameserver/App/process/FightProc.php

@@ -73,7 +73,7 @@ class FightProc {
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
         $prizeArr = array();
-
+      
         $wavesArr = GameConfig::waves_getItemArray($passGateId);
         $count = count($wavesArr);
         $wavesMo = $wavesArr[$count - 1];
@@ -435,7 +435,7 @@ class FightProc {
             if (ctx()->gates->GateList->$gateId->pass == 0) {
                 ctx()->gates->GateList->$gateId->pass = 1;
                 TaskProc::Day7TaskReset($gateId);                               # 刷新七日任务
-                $maxGateId = ctx()->gates->maxPassGateId();
+                $maxGateId = ctx()->gates->maxPassGateNumId();
                 if ($maxGateId > 0) {
                     self::Ranking_MainGateIndex($maxGateId);
                     self::IsAchievedMainGate_PassReward($maxGateId);
@@ -681,7 +681,7 @@ class FightProc {
         $isExistFinishReward = false;
         if ($type == 1) {
             $list = gMem()->zrevrange(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), 0, glc()->Rank_MainGateIndex_OnListRank, true);
-            $selfExtraInfo = ctx()->gates->maxPassGateId();
+            $selfExtraInfo = ctx()->gates->maxPassGateNumId();
 
             $memKey = MemKey_GameRun::RankReward_MainGateIndex_Zone_hash(req()->zoneid);
             $dic = gMem()->hgetall($memKey);