Bladeren bron

扫荡接口

cyzhao 1 jaar geleden
bovenliggende
commit
902cf8dfba

+ 1 - 1
Gameserver/App/base/CmdCode.php

@@ -291,7 +291,7 @@ class CmdCode {
     /**
      * 巡逻
      */
-    const cmd_fight_xunluoPrizeReceived = 6807;
+    const cmd_fight_sweep = 6807;
 
     /**
      * 开始挑战

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

@@ -350,7 +350,10 @@ class ErrCode {
      */
     const user_Gate_GatePriceHasReceive = 3203;
     
-    
+    /**
+     * 今日扫荡已达最大次数
+     */
+    const user_Gate_sweepMaxNum_limit = 3204;
 // </editor-fold>
 //
     

+ 1 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-06 16:53:57
+ // 日期: 2024-05-08 16:00:26
 ////////////////////
 
 /**

+ 18 - 8
Gameserver/App/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-30 17:59:32
+ // 日期: 2024-05-08 15:48:00
 ////////////////////
 
 
@@ -112,37 +112,37 @@ class sm_gate
     public $unlockGateId;
 
     /**
-    * @var Int32 巡逻每小时产生金币  
+    * @var Int32 巡逻每小时产生金币【废弃】  
     */
     public $gold_xunluo;
 
     /**
-    * @var Int32 巡逻每小时产生经验  
+    * @var Int32 巡逻每小时产生经验【废弃】  
     */
     public $exp_xunluo;
 
     /**
-    * @var String 产生精华道具时间(单位)分钟;例:开始分钟数,结束分钟数,两者间隔时间分钟数-道具ItemId,num;开始分钟数,结束分钟数,两者间隔时间分钟数-道具ItemId,num  
+    * @var String 产生精华道具时间(单位)分钟;例:开始分钟数,结束分钟数,两者间隔时间分钟数-道具ItemId,num;开始分钟数,结束分钟数,两者间隔时间分钟数-道具ItemId,num【废弃】  
     */
     public $xunluo_item_ts;
 
     /**
-    * @var String 产生装备的时间信息(单位)分钟  
+    * @var String 产生装备的时间信息(单位)分钟【废弃】  
     */
     public $xunluo_equip_ts;
 
     /**
-    * @var String 产生图纸的时间信息(单位)分钟  
+    * @var String 产生图纸的时间信息(单位)分钟【废弃】  
     */
     public $xunluo_tuzhi_ts;
 
     /**
-    * @var String 快速巡逻奖励信息  
+    * @var String 快速巡逻奖励信息【废弃】  
     */
     public $xueluo_quick_reward;
 
     /**
-    * @var Int32 快速巡逻每日可领取次数限制  
+    * @var Int32 快速巡逻每日可领取次数限制【废弃】  
     */
     public $xueluo_quick_num;
 
@@ -151,5 +151,15 @@ class sm_gate
     */
     public $gatePredicateId;
 
+    /**
+    * @var Int32 扫荡消耗体力 default(0) 
+    */
+    public $sweep_cost_tili;
+
+    /**
+    * @var Int32 扫荡次数 default(0) 
+    */
+    public $sweepNum;
+
 }
 

+ 1 - 1
Gameserver/App/model/Const/sm_plots.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-04-30 16:32:55
+ // 日期: 2024-05-07 15:32:55
 ////////////////////
 
 

+ 1 - 1
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-06 16:42:34
+ // 日期: 2024-05-08 11:43:45
 ////////////////////
 
 

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

@@ -68,6 +68,12 @@ class Info_Gates extends Object_ext {
      * @var type
      */
     public $evolveMaxId_right = 0;
+    
+    /**
+     * 扫荡
+     * @var type
+     */
+    public $fightSweepNum = 0;
 
     public function initialize() {
         $startId = 110011001;

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

@@ -26,14 +26,32 @@ class FightProc {
                 return FightProc::EvolveUnlock();
             case CmdCode::cmd_fight_plotSav:                                    # 6806 剧情回存
                 return FightProc::PlotSav();
-            case CmdCode::cmd_fight_xunluoPrizeReceived:                        #6807 巡逻奖励领取
-                return FightProc::XunluoPrizeReceived();
+            case CmdCode::cmd_fight_sweep:                                      #6807 
+                return FightProc::FightSweep();
             case CmdCode::fight_startFight:                                     # 6808 开始挑战
                 return self::StartFight();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    
+    public static function FightSweep() {
+        //list($gateId) = req()->paras;
+        
+        $costTili = GameConfig::gate_getItem(ctx()->gates->UnlockedGatesMaxId)->sweep_cost_tili;
+        my_Assert(ctx()->baseInfo->tili >= $costTili, ErrCode::notenough_tili);
+        $max = GameConfig::gate_getItem(ctx()->gates->UnlockedGatesMaxId)->sweepNum;
+        my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::user_Gate_sweepMaxNum_limit);
+        ctx()->gates->fightSweepNum += 1;
+        
+        UserProc::updateUserInfo();
+        $ret = array(
+            'tili' => ctx()->baseInfo->tili,
+            'fightSweepNum'=>ctx()->gates->fightSweepNum,
+            'store' => ctx()->store,
+        );
+        return Resp::ok($ret);
+    }
 
     /**
      * 6808 开始挑战 (扣除体力)
@@ -48,7 +66,7 @@ class FightProc {
     }
 
     /**
-     * 6807 巡逻奖励领取
+     * 6807 巡逻奖励领取 废弃
      * @return type
      */
     public static function XunluoPrizeReceived() {