Prechádzať zdrojové kódy

添加解锁功能v0.1

gwang 4 rokov pred
rodič
commit
c0735adcd6

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

@@ -6,7 +6,7 @@ namespace loyalsoft;
 // 由CodeGenerator创建。
 // 由CodeGenerator创建。
 // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
 // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
 // author: gwang 
 // author: gwang 
-// 日期: 2021-02-20 11:02:03
+// 日期: 2021-03-01 16:38:18
 ////////////////////
 ////////////////////
 
 
 /**
 /**
@@ -508,6 +508,22 @@ class GameConfig {
         return self::get_hash_item('task_node', $itemid);
         return self::get_hash_item('task_node', $itemid);
     }
     }
 
 
+    /**
+     * 
+     * @return \gate_mainland
+     */
+    public static function gate_mainland() {
+        static $a = null;
+        return self::initValue($a, 'gate_mainland');
+    }
+
+    /**
+     * @return \sm_gate_mainland gate_mainland item数据 
+     */
+    public static function gate_mainland_getItem($itemid) {
+        return self::get_hash_item('gate_mainland', $itemid);
+    }
+
     /**
     /**
      * 动作事件表
      * 动作事件表
      * @return \eventAction
      * @return \eventAction
@@ -556,6 +572,22 @@ class GameConfig {
         return self::get_hash_item('gate_zone', $itemid);
         return self::get_hash_item('gate_zone', $itemid);
     }
     }
 
 
+    /**
+     * 建筑表_2021.2.5
+     * @return \build
+     */
+    public static function build() {
+        static $a = null;
+        return self::initValue($a, 'build');
+    }
+
+    /**
+     * @return \sm_build build item数据 
+     */
+    public static function build_getItem($itemid) {
+        return self::get_hash_item('build', $itemid);
+    }
+
     /**
     /**
      * 神秘商城道具表-by goodstype
      * 神秘商城道具表-by goodstype
      * @return \secretshop_goodsType
      * @return \secretshop_goodsType

+ 17 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2021-02-24 15:52:15
+ // 日期: 2021-03-01 16:38:18
 ////////////////////
 ////////////////////
 
 
 /**
 /**
@@ -567,6 +567,22 @@ class GameConfig {
         return self::get_hash_item('gate_zone', $itemid);
         return self::get_hash_item('gate_zone', $itemid);
     }
     }
     /**
     /**
+    * 建筑表_2021.2.5
+    * @return \build
+    */
+    public static function build()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'build');
+    }
+    /**
+    * @return \sm_build build item数据 
+    */
+    public static function build_getItem($itemid)
+    { 
+        return self::get_hash_item('build', $itemid);
+    }
+    /**
     * 神秘商城道具表-by goodstype
     * 神秘商城道具表-by goodstype
     * @return \secretshop_goodsType
     * @return \secretshop_goodsType
     */
     */

+ 63 - 0
Gameserver/Amfphp/model/Const/sm_build.php

@@ -0,0 +1,63 @@
+<?php
+
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2021-02-24 10:58:42
+////////////////////
+
+
+/**
+ * Static Model build 建筑表_2021.2.5
+ */
+class sm_build
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var String 建筑名称  
+    */
+    public $name;
+
+    /**
+    * @var String 建筑资源 prefab 上层显示  
+    */
+    public $iconRes;
+
+    /**
+    * @var String 功能名称  
+    */
+    public $functionName;
+
+    /**
+    * @var String 功能界面(不能进入细节二级界面时 直接弹出功能界面)  
+    */
+    public $functionUI;
+
+    /**
+    * @var String 建筑详情 背景图片  
+    */
+    public $bgImage;
+
+    /**
+    * @var String 1001  
+    */
+    public $npcList;
+
+    /**
+    * @var String 解锁 条件 玩家等级  
+    */
+    public $playerLevelLimit;
+
+    /**
+    * @var String 房间描述信息  
+    */
+    public $speech;
+
+}
+

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gatelevel.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2021-02-09 14:19:53
+ // 日期: 2021-02-26 10:24:35
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2021-02-10 13:57:55
+ // 日期: 2021-02-25 14:14:30
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2021-02-10 14:01:15
+ // 日期: 2021-02-25 14:15:06
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_taskcard_shop.php

@@ -4,7 +4,7 @@
  // 由CodeGenerator创建。
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
  // author: gwang 
- // 日期: 2021-02-24 15:50:48
+ // 日期: 2021-02-25 14:13:27
 ////////////////////
 ////////////////////
 
 
 
 

+ 1 - 0
Gameserver/Amfphp/model/User/Data_UserGame.php

@@ -293,6 +293,7 @@ class Data_UserGame extends HashSaver {
         if ($user->level != $initLevel) {                                       # 插入玩家升级的系统消息
         if ($user->level != $initLevel) {                                       # 插入玩家升级的系统消息
             SystemProc::UserLevelUp(req()->zoneid, $user, $user->level);
             SystemProc::UserLevelUp(req()->zoneid, $user, $user->level);
             TaskProc::OnUserLevelUp($user->level);                              # 通知任务模块,这里应该有事件模块
             TaskProc::OnUserLevelUp($user->level);                              # 通知任务模块,这里应该有事件模块
+            EventProc::OnUserLevelup($initLevel, $user->level);                 # 事件模块
         }
         }
     }
     }
 
 

+ 12 - 0
Gameserver/Amfphp/model/User/Enum_EventType.php

@@ -68,4 +68,16 @@ class Enum_EventType {
      */
      */
     const NpcDialog = "NpcDialog";
     const NpcDialog = "NpcDialog";
 
 
+//    -----------
+
+    /**
+     * 解锁建筑(功能)
+     */
+    const UnlockBuild = "UnlockBuild";
+
+    /**
+     * 解锁地图
+     */
+    const UnlockMap = "UnlockMap";
+
 }
 }

+ 6 - 0
Gameserver/Amfphp/model/User/Info_PrivateState.php

@@ -96,6 +96,12 @@ class Info_PrivateState extends Object_ext {
      */
      */
     public $cornerSignNotifications = [];
     public $cornerSignNotifications = [];
 
 
+    /**
+     * 已解锁建筑
+     * @var array[int]
+     */
+    public $unlockedBuild = [];
+
 // <editor-fold defaultstate="collapsed" desc="    初始化    ">
 // <editor-fold defaultstate="collapsed" desc="    初始化    ">
 
 
     /**
     /**

+ 21 - 2
Gameserver/Amfphp/process/EventProc.php

@@ -20,8 +20,6 @@ class EventProc {
         }
         }
     }
     }
 
 
-//put your code here
-
     /**
     /**
      * [7201] 拉取角标通知
      * [7201] 拉取角标通知
      * @param req $req
      * @param req $req
@@ -66,4 +64,25 @@ class EventProc {
         
         
     }
     }
 
 
+    /**
+     * 当玩家等级变更
+     * @param type $old
+     * @param type $new
+     */
+    static function OnUserLevelup($old, $new) {
+        // 处理逻辑,
+        $ubs = req()->userInfo->game->privateState->unlockedBuild;
+        foreach (GameConfig::build() as $id => $b) {
+            isEditor() and $b = new \sm_build();
+            if (!in_array($id, $ubs)) {                                         # 尚未解锁的建筑,判断,已解锁的跳过
+                if ($b->playerLevelLimit <= $new) {                             # 符合解锁条件
+                    req()->userInfo->game->privateState->unlockedBuild[] = $id; # 插入解锁记录
+                    NormalEventProc::OnUnlockBuild($id, null);                   # 插入事件
+                }
+            }
+        }
+
+//        NormalEventProc::OnHelloWorld($arg1, $arg2);                            # 添加升级事件,算了这个暂时没人关注
+    }
+
 }
 }

+ 18 - 0
Gameserver/Amfphp/process/EventProc/NormalEventProc.php

@@ -113,4 +113,22 @@ class NormalEventProc {
         Resp::AddEvent(Enum_EventType::NpcDialog, $arg1, $arg2);
         Resp::AddEvent(Enum_EventType::NpcDialog, $arg1, $arg2);
     }
     }
 
 
+    /**
+     * 解锁 - 功能建筑
+     * @param type $arg1 建筑id
+     * @param type $arg2
+     */
+    public static function OnUnlockBuild($arg1, $arg2 = null) {
+        Resp::AddEvent(Enum_EventType::UnlockBuild, $arg1, $arg2);
+    }
+
+    /**
+     * 解锁 - 地图
+     * @param type $arg1 关卡id
+     * @param type $arg2
+     */
+    public static function OnUnlockMap($arg1, $arg2) {
+        Resp::AddEvent(Enum_EventType::UnlockMap, $arg1, $arg2);
+    }
+
 }
 }

+ 14 - 6
Gameserver/nbproject/private/private.xml

@@ -13,15 +13,23 @@
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
         <group>
         <group>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/FightProc.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/FightProc.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/StoreProc.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/CmdCode.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/TaskProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Enum_EventType.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/main.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Ins_TaskStep.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_TaskCard_Shop.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/EventProc.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/EventProc.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/UserProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Data_UserGame.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/FightProc/SweepGatesProc.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/FightProc/SweepGatesProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/UserProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_UserBase.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_UserGateDifficulty.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Ins_UGate.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/base/CmdCode.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Ins_TaskCard.php</file>
             <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Ins_TaskCard.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/main.php</file>
-            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Ins_TaskStep.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/process/StoreProc.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_UserGameHero.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_PrivateState.php</file>
+            <file>file:/D:/local_svn/0_ylsj2019/ylsj2019Server/Gameserver/Amfphp/model/User/Info_PublicState.php</file>
         </group>
         </group>
     </open-files>
     </open-files>
 </project-private>
 </project-private>