cyzhao 1 year ago
parent
commit
8990d62b60

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

@@ -188,6 +188,11 @@ class CmdCode {
      * 
      */
     const cmd_fight_plotSav = 6806;
+    
+    /**
+     * 巡逻
+     */
+    const cmd_fight_xunluoPrizeReceived = 6807;
 
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">

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

@@ -45,6 +45,18 @@ class Info_Gates extends Object_ext {
     #[ArrayType]
     public $evolveUnlockRecord = array();
 
+    /**
+     * 巡逻领取奖励的时间
+     * @var int
+     */
+    public $xunluo_StartTs = 0; 
+
+    /**
+     * 快速巡逻的购买记录
+     * @var int
+     */
+    public $xunluo_quick_buyRecord = 0;
+    
     public function initialize() {
         $startId = 1;
         $this->CurrentGateId = $startId;

+ 6 - 1
Gameserver/App/model/User/Info_UserBase.php

@@ -122,7 +122,12 @@ class Info_UserBase extends Object_ext {
         my_Assert($amt >= 0, "体力amt小于0");
         //ActiveProc::ChangeTili($amt);
     }
-
+    
+    function Consume_tili($amt) {
+        my_Assert($amt >= 0, "体力amt小于0");
+        //ActiveProc::ChangeTili($amt);
+    }
+    
     /**
      * 用户获得金币
      * @param int $amt

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

@@ -33,10 +33,38 @@ class FightProc {
                 return FightProc::EvolveUnlock();
             case CmdCode::cmd_fight_plotSav:                                    # 6806 剧情回存
                 return FightProc::PlotSav();
+            case CmdCode::cmd_fight_xunluoPrizeReceived:                        #6807 巡逻奖励领取
+                return FightProc::XunluoPrizeReceived();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
+    /**
+     * 6807 巡逻奖励领取
+     * @return type
+     */
+    public static function XunluoPrizeReceived() {
+        list($type) = req()->paras;
+            
+        $gateId = ctx()->gates->UnlockedGatesMaxId;
+        $gateMo = GameConfig::gate_getItem($gateId);
+        my_Assert($gateMo!=null, ErrCode::err_const_no);
+        
+        
+        
+        if($type == 1){//巡逻
+            ctx()->gates->xunluo_StartTs = now();
+        } else {//快速巡逻
+            ctx()->gates->xunluo_quick_buyRecord += 1;
+            ctx()->baseInfo->Consume_tili(15);           
+        }    
+        
+        UserProc::updateUserInfo();
+        $ret = array(                   
+            'ok' => 1,        
+            );
+        return Resp::ok($ret);
+    }
     
     /**
      * 剧情回存