Sfoglia il codice sorgente

Merge branch 'dev' of http://ylsjtt.game7000.com:3000/YLSJ/jzhj2024server into dev

王刚 1 settimana fa
parent
commit
3c676c9281

+ 14 - 0
Gameserver/App/model/User/Data_UserGame.php

@@ -91,6 +91,20 @@ class Data_UserGame extends HashSaver {
             $this->heros()->fixArray();
             $this->task()->fixArray();
             $this->store()->fixArray();
+            //$this->
+
+            $exploreAreas = $this->store()->exploreArea;
+            if ($exploreAreas != null) {
+                $dic = new \stdClass();
+                foreach ($this->store()->exploreArea as $areaId => $area) {
+                    $Ins_ExploreArea = new Ins_ExploreArea($area);
+                    $Ins_ExploreArea->fixArray();
+                  
+                    $dic->$areaId = $Ins_ExploreArea;                  
+                }
+                $this->store()->exploreArea = $dic;
+            }
+            
         }
     }
 

+ 29 - 15
Gameserver/App/model/User/Info_Store.php

@@ -74,14 +74,13 @@ class Info_Store extends Object_ext {
     /**
      * @var int current UID
      */
-    public $cuid = 10000;   
-    
-    
+    public $cuid = 10000;
+
     /**
      * @var int $petUid
      */
-    public $petUid = 1;   
-    
+    public $petUid = 1;
+
     /**
      *  宠物背包数据
      */
@@ -104,13 +103,13 @@ class Info_Store extends Object_ext {
      * @var type
      */
     public $petUids_supportFight_position;
-    
+
     /**
      * 孵蛋坑位信息
      * @var type
      */
     public $breedEggLocation;
-    
+
     /**
      * 宠物探索区域
      * @var type
@@ -123,9 +122,8 @@ class Info_Store extends Object_ext {
 
     public function __construct($arg = null) {
         if ($arg == null) {
-            $this->exploreArea = new \stdClass();
             $this->petUids_supportFight_position = new \stdClass();
-                       
+
             $this->items = new \stdClass();
             $this->gemStore = new \stdClass();
             $this->equip = new \stdClass();
@@ -146,24 +144,26 @@ class Info_Store extends Object_ext {
                 }
                 $this->gemEquip->$k = $item;
             }
-            
+
             $str = GameConfig::glc2()->Pet_BreedLocationUnlockInfo;
             $this->breedEggLocation = new \stdClass();
-            if($str != null){
+            if ($str != null) {
                 $list = explode(';', $str);
                 foreach ($list as $value) {
                     $s = explode(',', $value);
-                    $k = $s[0]; 
+                    $k = $s[0];
                     $ins_breed = new Ins_BreedEggSlot();
                     $ins_breed->uid = $k;
-                    $ins_breed->unlock = 0;       
-                    if($s[1] == 0){                                            
-                        $ins_breed->unlock = 1;                       
+                    $ins_breed->unlock = 0;
+                    if ($s[1] == 0) {
+                        $ins_breed->unlock = 1;
                     }
                     $this->breedEggLocation->$k = $ins_breed;
                 }
             }
             
+            $this->initExploreArea();
+            
         } else {
             parent::__construct($arg);
         }
@@ -184,4 +184,18 @@ class Info_Store extends Object_ext {
     public function nextUID() {
         return $this->cuid++;
     }
+
+    public function initExploreArea() {
+        if($this->exploreArea == null){
+            $this->exploreArea = new \stdClass();
+        }
+                   
+        $exploreAreas = GameConfig::pet_area();
+        foreach ($exploreAreas as $areaId => $areaArr) {
+            if(!StlUtil::dictHasProperty($this->exploreArea, $areaId)){
+                $Ins_ExploreArea = new Ins_ExploreArea($areaArr[0]);
+                $this->exploreArea->$areaId = $Ins_ExploreArea;
+            }                          
+        }
+    }
 }

+ 2 - 1
Gameserver/App/model/User/Ins_ExploreArea.php

@@ -39,7 +39,7 @@ class Ins_ExploreArea extends Object_ext{
      * 产出
      * @var type
      */
-    public $output_num = 0;
+    public $output_count = 0;
 
     /**
      * 时间
@@ -51,6 +51,7 @@ class Ins_ExploreArea extends Object_ext{
      * 派遣宠物uid
      * @var type
      */
+    #[ArrayType]
     public $explorePetList = array();
     
     /**

+ 7 - 7
Gameserver/App/process/PetProc.php

@@ -123,7 +123,7 @@ class PetProc {
         if (count($vo->explorePetList) == 0) {
             $vo->startTs = 0;
             $vo->endTs = 0;
-            $vo->output_num = 0;
+            $vo->output_count = 0;
             $vo->output_ts = 0;
         } else {
             if ($vo->startTs == 0) {
@@ -133,7 +133,7 @@ class PetProc {
             $ts = self::GetAreaOutPutInfo($vo, 2);
             $num = self::GetAreaOutPutInfo($vo, 1);
             $vo->endTs = $vo->startTs + $ts;
-            $vo->output_num = $num;
+            $vo->output_count = $num;
             $vo->output_ts = $vo->endTs - $vo->startTs;
         }
 
@@ -206,7 +206,7 @@ class PetProc {
         if (count($petUidList) == 0) {
             $ins_ExploreArea->startTs = 0;
             $ins_ExploreArea->endTs = 0;
-            $ins_ExploreArea->output_num = 0;
+            $ins_ExploreArea->output_count = 0;
             $ins_ExploreArea->output_ts = 0;
         } else {
             if ($ins_ExploreArea->startTs == 0) {
@@ -216,7 +216,7 @@ class PetProc {
             $ts = self::GetAreaOutPutInfo($ins_ExploreArea, 2);
             $num = self::GetAreaOutPutInfo($ins_ExploreArea, 1);
             $ins_ExploreArea->endTs = $ins_ExploreArea->startTs + $ts;
-            $ins_ExploreArea->output_num = $num;
+            $ins_ExploreArea->output_count = $num;
             $ins_ExploreArea->output_ts = $ins_ExploreArea->endTs - $ins_ExploreArea->startTs;
         }
    
@@ -253,7 +253,7 @@ class PetProc {
         $vo->explorePetList = array();
         $vo->startTs = 0;
         $vo->endTs = 0;
-        $vo->output_num = 0;
+        $vo->output_count = 0;
         $vo->output_ts = 0;
 
         ctx()->store->exploreArea->$areaId = $vo;
@@ -279,7 +279,7 @@ class PetProc {
             $tt = $vo->endTs - $vo->startTs;
         }
 
-        $ts_n = $vo->output_ts / $vo->output_num;
+        $ts_n = $vo->output_ts / $vo->output_count;
         $num = intval($tt *= $ts_n);
         $goodsStr = $vo->mo()->reward_fixed . ',' . $num;
         StoreProc::AddMultiItemInStore($goodsStr);
@@ -293,7 +293,7 @@ class PetProc {
         //$vo->explorePetList = array();             
         $vo->startTs = 0;
         $vo->endTs = 0;
-        $vo->output_num = 0;
+        $vo->output_count = 0;
         $vo->output_ts = 0;
 
         ctx()->store->exploreArea->$areaId = $vo;

+ 2 - 1
Gameserver/App/process/UserProc.php

@@ -392,6 +392,7 @@ class UserProc {
         } else {                                                                # 2.如果玩家已存在,则处理普通登录流程
             req()->game = $game;                                                # 给Req挂载玩家数据
             $game->base(true)->Reset_tilits();                                      # 修正体力ts
+            ctx()->store->initExploreArea();
             UserProc::checkContidays();                                         # 连续登录,状态检查
             //PayProc::m_refreshChargeOrders();                                   # 刷新订单, 多平台版本
             PayProc::selfhelpCheckOrders();
@@ -575,7 +576,7 @@ class UserProc {
         FightProc::SubFunDateInit_Config();
 
         ActiveProc::ClearFlipCardInfo();
-        FightProc::ResetTurnNum();
+        FightProc::ResetTurnNum();       
     }
 
 //    static function clear() {