Explorar o código

修改: 玩家初始金币和宝石数据取自globalsettings.

王刚 hai 1 ano
pai
achega
16b6f12f28

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

@@ -4,7 +4,7 @@
 // 由CodeGenerator创建。
 // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
 // author: gwang
-// 日期: 2024-05-30 17:32:02
+// 日期: 2024-06-05 18:14:10
 ////////////////////
 
 namespace loyalsoft;

+ 11 - 1
Gameserver/App/model/Const/sm_globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-31 15:50:48
+ // 日期: 2024-06-05 18:14:13
 ////////////////////
 
 
@@ -213,5 +213,15 @@ class sm_globalsettings
     */
     public $Rank_FightPower_Explain;
 
+    /**
+    * @var int 玩家初始金币  
+    */
+    public $Init_Player_gold;
+
+    /**
+    * @var int 玩家初始钻石  
+    */
+    public $Init_Player_cash;
+
 }
 

+ 11 - 13
Gameserver/App/model/User/Info_UserBase.php

@@ -101,35 +101,34 @@ class Info_UserBase extends Object_ext {
      * @var type
      */
     public $animation = 0;
-    
+
     /**
      * 首充奖励是否领取过首充奖励是否领取过
      * @var type
      */
     public $fRechargePriceReceived = 0;
-    
+
     /**
      * 洗练石
      * @var type
      */
     public $xilianStone = 0;
-    
+
     public function initialize() {
 //        my_Assert(GameConfig::primordial_data(), "找不到账号初始化数据");         # 防御
-        $this->gold = 1000000;
-        $this->cash = 5000;
+        $this->gold = glc()->Init_Player_gold;
+        $this->cash = glc()->Init_Player_cash;
         $this->xp = 0;
         $this->tili = GameConfig::globalsettings()->tili_RecoverrMax;           # 恢复体力上限
         $this->maxXp = GameConfig::player_level_getItem(2)->xp_need;
-        
+
         $this->level = 1;
         $this->name = '';
 
-        
         $this->img = "";
-        
+
         $heroMo = GameConfig::hero_getItem(1);
-        $this->headImg = $heroMo->img;               
+        $this->headImg = $heroMo->img;
     }
 
     // <editor-fold defaultstate="collapsed" desc="  方法  ">
@@ -228,7 +227,7 @@ class Info_UserBase extends Object_ext {
      * @param type $amt
      */
     function Add_Cash($amt) {
-        my_Assert($amt >= 0, "amt值为负");       
+        my_Assert($amt >= 0, "amt值为负");
         $this->cash += $amt;
     }
 
@@ -244,7 +243,7 @@ class Info_UserBase extends Object_ext {
                 return true;
             }
         }
-        
+
         TaskProc::OnConsumeCashNum($amt);
         return false;
     }
@@ -254,7 +253,7 @@ class Info_UserBase extends Object_ext {
      * @param int $amt
      */
     function Add_Exp($amt) {
-        my_Assert($amt >= 0, "amt值为负");       
+        my_Assert($amt >= 0, "amt值为负");
         $cfgLVs = GameConfig::player_level();
 
         $this->xp += $amt;
@@ -274,7 +273,6 @@ class Info_UserBase extends Object_ext {
                 break;
             }
         }
-        
     }
 
     //