Browse Source

代码调整, 增加注释.

王刚 3 năm trước cách đây
mục cha
commit
59cdc6fb4b

+ 32 - 31
Gameserver/Amfphp/model/User/Info_Map.php

@@ -5,6 +5,7 @@ namespace loyalsoft;
 /**
  * 玩家关卡地图数据
  * @author gwang
+ * @deprecated since 2022.3 换开放地图版转 Info_NewMap->Ins_FootHold
  * @version 
  *         1.0.0 Created at 2021年3月2日14:32:52 关卡分三层处理 大陆->区域->关卡.
  */
@@ -15,7 +16,7 @@ class Info_Map extends Object_ext {
      * @var dict<int,Ins_Mainland>
      */
     public $mainlands;
-    
+
     /**
      * 战斗关卡记录--1.记录剧情关卡记录;2.副本唤灵师关卡 3.副本武器关卡 4.副本言灵关卡  
      * @param type $arg
@@ -33,7 +34,6 @@ class Info_Map extends Object_ext {
 //            foreach ($arr as $key) {
 //                $this->battleRecord->$key = array();
 //            }
-          
             // 直接初始化8个大陆的基本数据
             $this->mainlands = ObjectInit();
             foreach (GameConfig::gate_mainland() as $id => $land) {
@@ -57,46 +57,47 @@ class Info_Map extends Object_ext {
         }
     }
 
-    public function addBattleRecord($gateId) {                    
-        if(!in_array($gateId,$this->battleRecord)){
-            if(strlen($gateId) == 8 && substr($gateId,0,3) == 2001){
+    public function addBattleRecord($gateId) {
+        if (!in_array($gateId, $this->battleRecord)) {
+            if (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2001) {
                 $type = Enum_TargetStatistics::HuanLingShiGateId_ComUserNum;
-            } elseif (strlen($gateId) == 8 && substr($gateId,0,3) == 2002) {
+            } elseif (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2002) {
                 $type = Enum_TargetStatistics::WeaponGateId_ComUserNum;
-            } elseif (strlen($gateId) == 8 && substr($gateId,0,3) == 2003) {
+            } elseif (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2003) {
                 $type = Enum_TargetStatistics::YanLingGateId_ComUserNum;
             } else {
                 $type = Enum_TargetStatistics::storyGateId_ComUserNum;
             }
-                      
+
             $arr = $this->battleRecord;
             $arr[] = $gateId;
-            $this->battleRecord= $arr;
+            $this->battleRecord = $arr;
             StatisticsProc::TargetStatistics($type, $gateId);
         }
     }
-    
-    public function addBattleNumRecord($gateId,$ret) {                           
-            if(strlen($gateId) == 8 && substr($gateId,0,3) == 2001){
-                $type = Enum_TargetStatistics::HuanLingShiGateId_BattleNum;
-            } elseif (strlen($gateId) == 8 && substr($gateId,0,3) == 2002) {
-                $type = Enum_TargetStatistics::WeaponGateId_BattleNum;
-            } elseif (strlen($gateId) == 8 && substr($gateId,0,3) == 2003) {
-                $type = Enum_TargetStatistics::YanLingGateId_BattleNum;
-            } else {
-                $type = Enum_TargetStatistics::storyGateId_BattleNum;
-            }
-            $battleNum = 0;
+
+    public function addBattleNumRecord($gateId, $ret) {
+        if (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2001) {
+            $type = Enum_TargetStatistics::HuanLingShiGateId_BattleNum;
+        } elseif (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2002) {
+            $type = Enum_TargetStatistics::WeaponGateId_BattleNum;
+        } elseif (strlen($gateId) == 8 && substr($gateId, 0, 3) == 2003) {
+            $type = Enum_TargetStatistics::YanLingGateId_BattleNum;
+        } else {
+            $type = Enum_TargetStatistics::storyGateId_BattleNum;
+        }
+        $battleNum = 0;
+        $passNum = 0;
+        if ($ret == true) {
+            $battleNum = 1;
+            $passNum = 1;
+        } else {
+            $battleNum = 1;
             $passNum = 0;
-            if($ret == true){
-                $battleNum = 1;
-                $passNum = 1;
-            } else {
-                $battleNum = 1;
-                $passNum = 0;
-            }
-                      
-            $ctx = $battleNum."/".$passNum;
-            StatisticsProc::TargetStatistics($type, $gateId,$ctx);        
+        }
+
+        $ctx = $battleNum . "/" . $passNum;
+        StatisticsProc::TargetStatistics($type, $gateId, $ctx);
     }
+
 }

+ 2 - 1
Gameserver/Amfphp/model/User/Ins_Mainland.php

@@ -5,6 +5,7 @@ namespace loyalsoft;
 /**
  * 八大陆数据 extends Object
  * 困难难度不会垮大陆关联, 只在本大陆中同一个区域或者不同区域之间互相关联(此系采访策划后答复)
+ * @deprecated since 2022.3 换开放地图版转 Info_NewMap->Ins_FootHold
  * @version
  *          1.0.0 八大陆数据 at 2021年3月2日14:37:51 -gwang  
  * @author gwang (mail@wanggangzero.cn)
@@ -47,7 +48,7 @@ class Ins_Mainland extends Object_ext {
         $zidArr = explode(',', $ldc->containZones);
         $ret = array();
         $w = (array) GameConfig::gate_zone();
-        array_walk($w, function ($v, $k) use($zidArr, &$ret) {
+        array_walk($w, function ($v, $k) use ($zidArr, &$ret) {
             if (in_array($k, $zidArr)) {
                 $ret[] = $v;
             }

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

@@ -5,6 +5,7 @@ namespace loyalsoft;
 /**
  * 玩家关卡地图区域数据
  * @author gwang
+ * @deprecated since 2022.3 换开放地图版转 Info_NewMap->Ins_FootHold
  */
 class Ins_Mapzone extends Object_ext {