Bladeren bron

fix: 关卡id编号调整.

王刚 1 jaar geleden
bovenliggende
commit
efb2e183a0
2 gewijzigde bestanden met toevoegingen van 34 en 18 verwijderingen
  1. 21 0
      Gameserver/App/model/User/Info_Gates.php
  2. 13 18
      Gameserver/App/process/FightProc.php

+ 21 - 0
Gameserver/App/model/User/Info_Gates.php

@@ -92,4 +92,25 @@ class Info_Gates extends Object_ext {
             parent::__construct($arg);
         }
     }
+
+    /**
+     * @return 解锁下一剧情关卡
+     */
+    public function UnlockNextPlotGate() {
+        $nextId = $this->CurrentGateId;
+        foreach (GameConfig::gate() as $k => $v) {
+            isEditor() and $v = new \sm_gate();
+            if ($v->unlockGateId == $this->CurrentGateId) {
+                $nextId = $v->gateId;
+            }
+        }
+        if (!StlUtil::dictHasProperty($this->GateList, $nextId)) {
+            $this->CurrentGateId = $nextId;
+            $this->UnlockedGatesMaxId = $nextId;
+            $gate = new Ins_GateInfo();
+            $gate->GateId = $nextId;
+            $this->GateList->$nextId = $gate;
+        }
+        return $nextId;
+    }
 }

+ 13 - 18
Gameserver/App/process/FightProc.php

@@ -197,24 +197,26 @@ class FightProc {
                 $price = $price . ";" . $equipId . ',' . $equipNum;
             }
             StoreProc::AddMultiItemInStore($price);
-            ctx()->gates->xunluo_StartTs = now();           
+            ctx()->gates->xunluo_StartTs = now();
         } else {//快速巡逻
             my_Assert(ctx()->gates->xunluo_quick_buyRecord < $gateMo->xueluo_quick_num, ErrCode::err_const_no);
             ctx()->gates->xunluo_quick_buyRecord += 1;
-            ctx()->baseInfo->Consume_tili(15);          
+            ctx()->baseInfo->Consume_tili(15);
             StoreProc::AddMultiItemInStore($gateMo->xueluo_quick_reward);
         }
 
         UserProc::updateUserInfo();
-        $ret = array(          
-            'tili'=> ctx()->baseInfo->tili,
-            'gates' => ctx()->gates,        
+        $ret = array(
+            'tili' => ctx()->baseInfo->tili,
+            'gates' => ctx()->gates,
         );
         return Resp::ok($ret);
     }
+
     public static function FightDailyClear() {
         ctx()->gates->xunluo_quick_buyRecord = 0;
     }
+
     /**
      * 剧情回存
      * @return type
@@ -248,11 +250,11 @@ class FightProc {
         } else {
             $dic = GameConfig::evolve();
             foreach ($dic as $key => $value) {
-                if($value->specificEvolveId == $id){
+                if ($value->specificEvolveId == $id) {
                     $mo = $value;
                 }
             }
-            
+
             my_Assert($mo != null, ErrCode::err_const_no);
             if ($mo->specificEvolveCost != null) {
                 $cost = explode(',', $mo->specificEvolveCost);
@@ -279,7 +281,7 @@ class FightProc {
      */
     public static function GateChallengePriceReviced() {
         list($zhangjieId, $gateId) = req()->paras;
-           
+
         $gateMo = GameConfig::gate_getItem($gateId);
         my_Assert($gateMo != null, ErrCode::err_const_no);
 
@@ -289,7 +291,7 @@ class FightProc {
 
         my_Assert(!in_array($gateId, ctx()->gates->GatesChallengeRecord->$zhangjieId), ErrCode::user_Gate_GatePriceHasReceive);
         my_Assert(in_array($gateMo->challengeUnlockId, ctx()->gates->GatesChallengeRecord->$zhangjieId), ErrCode::user_Gate_GateNoUnlock);
-               
+
         ctx()->gates->GatesChallengeRecord->$zhangjieId[] = $gateId;
 
         StoreProc::AddMultiItemInStore($gateMo->reward_win);
@@ -341,14 +343,7 @@ class FightProc {
                 ctx()->gates->GateList->$gateId->pass = 1;
             }
             StoreProc::AddMultiItemInStore($gateMo->reward_win);
-            $newGateId = $gateId + 1;
-            if (!StlUtil::dictHasProperty(ctx()->gates->GateList, $newGateId)) {
-                ctx()->gates->CurrentGateId = $newGateId;
-                ctx()->gates->UnlockedGatesMaxId = $newGateId;
-                $gate = new Ins_GateInfo();
-                $gate->GateId = $newGateId;
-                ctx()->gates->GateList->$newGateId = $gate;
-            }
+            ctx()->gates->UnlockNextPlotGate();
         } else {                                                                # 失败
             StoreProc::AddMultiItemInStore($gateMo->reward_fail);
         }
@@ -393,7 +388,7 @@ class FightProc {
                 break;
             case 2:
                 $ts = $gateMo->first_ts2 * 60;
-                if ($gateInfo->MaxSeconds>= $ts) {
+                if ($gateInfo->MaxSeconds >= $ts) {
                     $tag = true;
                 }
                 $mask = 2;