cyzhao 1 год назад
Родитель
Сommit
7f92a9bac0

+ 2 - 0
Gameserver/App/base/CmdCode.php

@@ -165,6 +165,8 @@ class CmdCode {
      */
     const cmd_fight_selectGate = 6803;
     
+    const cmd_fight_gateChallengePriceReviced = 6804;
+    
     // </editor-fold>
     
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">

+ 6 - 1
Gameserver/App/base/ErrCode.php

@@ -338,7 +338,12 @@ class ErrCode {
 
 //   // <editor-fold defaultstate="collapsed" desc="    关卡     ">    
 
-    const user_Gate_NoUserGateInfo = 3201;
+    const user_Gate_NoUserGateInfo = 3201;  
+    
+    /**
+     * 奖励已经被领取
+     */
+    const user_Gate_GatePriceHasReceive = 3202;
 // </editor-fold>
 //
     

+ 33 - 1
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-08-18 09:41:56
+ // 日期: 2023-08-23 11:52:29
 ////////////////////
 
 namespace loyalsoft;
@@ -447,6 +447,38 @@ class GameConfig {
         return self::get_hash_item('shop_junbei', $itemid);
     }
     /**
+    * 挑战表
+    * @return \gate_challenge
+    */
+    public static function gate_challenge()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'gate_challenge');
+    }
+    /**
+    * @return \sm_gate_challenge gate_challenge item数据 
+    */
+    public static function gate_challenge_getItem($itemid)
+    { 
+        return self::get_hash_item('gate_challenge', $itemid);
+    }
+    /**
+    * 进化表
+    * @return \evolve
+    */
+    public static function evolve()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'evolve');
+    }
+    /**
+    * @return \sm_evolve evolve item数据 
+    */
+    public static function evolve_getItem($itemid)
+    { 
+        return self::get_hash_item('evolve', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 3 - 5
Gameserver/App/model/User/Info_Gates.php

@@ -30,8 +30,8 @@ class Info_Gates extends Object_ext {
     public $GateList = null;
     
     /**
-     * 
-     * @var type
+     * 挑战功能领取记录
+     * @var new \stdClass()
      */
     public $GatesChallengeRecord = null;
     
@@ -58,9 +58,7 @@ class Info_Gates extends Object_ext {
                 $this->GateList = new \stdClass();    
                 $Ins_GateInfo = new Ins_GateInfo();
                 $Ins_GateInfo->GateId = $this->CurrentGateId;
-                $this->GateList->$startId=$Ins_GateInfo;        
-                
-                
+                $this->GateList->$startId=$Ins_GateInfo;                       
             }
             
             $this->GatesChallengeRecord = new \stdClass();

+ 38 - 0
Gameserver/App/process/FightProc.php

@@ -27,11 +27,49 @@ class FightProc {
                 return FightProc::PassGateTsPrizeReceive(); 
             case CmdCode::cmd_fight_selectGate:                                 # 6803 关卡选择
                 return FightProc::SelectGate();
+            case CmdCode::cmd_fight_gateChallengePriceReviced:                  # 6804 
+                return FightProc::GateChallengePriceReviced();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    /**
+     * 挑战奖励领取
+     * @return type
+     */
+    public static function GateChallengePriceReviced() {
+        list($zhangjieId, $gateId) = req()->paras;
+        
+        $mo = GameConfig::gate_challenge_getItem($zhangjieId);
+        my_Assert($mo!=null, ErrCode::err_const_no);
+        
+//        $list = explode(',', $mo->gates);
+//        my_Assert(in_array($gateId,$list), ErrCode::err_const_no);
+        
+        $gateMo = GameConfig::gate_getItem($gateId);
+        my_Assert($gateMo!=null, ErrCode::err_const_no);
+        
+        if(!StlUtil::dictHasProperty(ctx()->gates->GatesChallengeRecord, $zhangjieId)){
+            ctx()->gates->GatesChallengeRecord->$zhangjieId = array();
+        }
+        
+        my_Assert(!in_array($gateId,ctx()->gates->GatesChallengeRecord->$zhangjieId), ErrCode::user_Gate_GatePriceHasReceive);
+        ctx()->gates->GatesChallengeRecord->$zhangjieId[] = $gateId;
+        
+        StoreProc::AddMultiItemInStore($gateMo->reward_win);
+        
+        ctx()->gates->CurrentGateId = $gateId;
+        
+        UserProc::updateUserInfo();
+        $ret = array(          
+            'store' => ctx()->store, 
+            'gates' => ctx()->gates,        
+            );
+        return Resp::ok($ret);
+    }
+    
+    
     /**
      * 关卡选择
      * @return type