cyzhao преди 1 седмица
родител
ревизия
cec063d399
променени са 2 файла, в които са добавени 31 реда и са изтрити 16 реда
  1. 29 15
      Gameserver/App/model/User/Info_Store.php
  2. 2 1
      Gameserver/App/process/UserProc.php

+ 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/process/UserProc.php

@@ -393,6 +393,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();
@@ -576,7 +577,7 @@ class UserProc {
         FightProc::SubFunDateInit_Config();
         
         ActiveProc::ClearFlipCardInfo();
-        FightProc::ResetTurnNum();
+        FightProc::ResetTurnNum();       
     }
 
 //    static function clear() {