瀏覽代碼

剧情接口

cyzhao 1 年之前
父節點
當前提交
4f31c8776c

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

@@ -183,6 +183,11 @@ class CmdCode {
      * 进化解锁
      */
     const cmd_fight_evolveUnlock = 6805;
+    
+    /**
+     * 
+     */
+    const cmd_fight_plotSav = 6806;
 
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-09-01 10:01:44
+ // 日期: 2023-09-01 15:47:11
 ////////////////////
 
 namespace loyalsoft;
@@ -527,6 +527,22 @@ class GameConfig {
         return self::get_hash_item('equip_compose', $itemid);
     }
     /**
+    * 剧情表
+    * @return \plot
+    */
+    public static function plot()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'plot');
+    }
+    /**
+    * @return \sm_plot plot item数据 
+    */
+    public static function plot_getItem($gateId, $stage)
+    { 
+        return self::get_hash_item('plot', $gateId)->$stage;
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

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

@@ -34,4 +34,10 @@ class Ins_GateInfo {
      */
     public $pass = 0; 
     
+    /**
+     * 本关剧情是否已经播放过 0:没有 1:有
+     * @var type
+     */
+    public $plotStart = 0;
+    
 }

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

@@ -31,11 +31,30 @@ class FightProc {
                 return FightProc::GateChallengePriceReviced();
             case CmdCode::cmd_fight_evolveUnlock:                               # 6805进化解锁
                 return FightProc::EvolveUnlock();
+            case CmdCode::cmd_fight_plotSav:                                    # 6806 剧情回存
+                return FightProc::PlotSav();
             default:
                 Err(ErrCode::cmd_err);
         }
     }
     
+    /**
+     * 剧情回存
+     * @return type
+     */
+    public static function PlotSav() {
+        list($gateId) = req()->paras;
+               
+        my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList,$gateId), ErrCode::err_const_no);
+        ctx()->gates->GateList->$gateId->plotStart = 1;
+                           
+        UserProc::updateUserInfo();
+        $ret = array(                   
+            'ok' => 1,        
+            );
+        return Resp::ok($ret);
+    }
+    
     /**
      * EvolveUnlock
      * @return type