소스 검색

bug统一提交

cyzhao 3 년 전
부모
커밋
0994a6aa68

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-05-25 15:46:25
+ // 日期: 2022-05-25 17:33:15
 ////////////////////
 
 /**

+ 8 - 0
Gameserver/Amfphp/model/User/Info_NewMap.php

@@ -41,11 +41,19 @@ class Info_NewMap extends Object_ext {
      */
     public $lastMapId = 0;
     
+    /**
+     * 当前据点id
+     * @var type
+     */
+    public $curFootholdId = 0;
+            
     function __construct($arg = null) {
         if (null === $arg) {
             // 直接初始化8个大陆的基本数据
             $initMapid = 503099;                                                # 新手村的id
             $this->curMapId = $initMapid;                                       # 当前位置为新手村
+            $this->curFootholdId = 503099;                                      # 当前据点id
+            
             $this->unlockedFootholds = ObjectInit();
             $mo = GameConfig::gate_getItem($initMapid);
             $footHold = new Ins_FootHold();

+ 2 - 2
Gameserver/Amfphp/process/HeroProc.php

@@ -84,7 +84,7 @@ class HeroProc {
         $cardId  = req()->paras[0];
         //$mosterId = req()->paras[1];      # 提取参数      
         
-        my_Assert(StlUtil::dictHasProperty(ctx()->store, $cardId) , ErrCode::err_const_no);
+        my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $cardId) , ErrCode::err_const_no);
         
         $mo = GameConfig::item_yanlingbook_getItem($cardId);
         my_Assert($mo != null, ErrCode::err_const_no);
@@ -700,7 +700,7 @@ class HeroProc {
             foreach ($heroList as $hero_id) {
                 if ($hero_id == $hero->typeId) {
                     $wp = $mo;
-                    break;
+                    break 2;
                 }
             }
 

+ 33 - 19
Gameserver/Amfphp/process/MapProc.php

@@ -47,7 +47,7 @@ class MapProc {
         $y = req()->paras[2];      
         $z = req()->paras[3];      
         $newMap = ctx()->newMap(true);   
-        $curMapId = $newMap->curMapId;
+        //$curMapId = $newMap->curMapId;
         
         $itemId = 0;
         $dic = ctx()->store()->items;
@@ -61,29 +61,32 @@ class MapProc {
         my_Assert($itemId != 0, ErrCode::err_const_no);
         
         StoreProc::removeItemFromStore(ctx()->store, $itemId);
-       
-        $gateZone = GameConfig::gate_zone();
-        my_Assert($gateZone != null, ErrCode::err_const_no);
-        foreach ($gateZone as $zoneid => $val) {
-            $list = explode(',', $val->contains);
-            if(in_array($curMapId, $list)){
-                $mid = $list[0];
-                break;
-            }
-        }      
-        
-        $newMap->curMapId = $mid; 
+        //找据点,地图在gate_zone里有配置;没有的就算是副本--暂时先这么着    
+//        $gateZone = GameConfig::gate_zone();
+//        my_Assert($gateZone != null, ErrCode::err_const_no);
+//        foreach ($gateZone as $zoneid => $val) {
+//            $list = explode(',', $val->contains);
+//            if(in_array($curMapId, $list)){
+//                $mid = $list[0];
+//                break;
+//            }
+//        }
+        $curFootholdId = $newMap->curFootholdId;      
+        if($curFootholdId == null){
+            $curFootholdId = 503099;
+        }
+        $newMap->curMapId = $curFootholdId;
         
         $data = new Ins_ChuansongzhenMapData();
-        $data->mapId = $mid;
+        $data->mapId = $curFootholdId;
         $data->lastMapId = $mapId;
         $data->position_x = $x;
         $data->position_y = $y;
         $data->position_z = $z;
-        
         $newMap->huichengquanRecord->$mapId = $data;
-        $newMap->lastMapId = $mapId;
         
+        $newMap->lastMapId = $mapId;
+                          
         ctx()->newMap = $newMap;
 
         UserProc::updateUserInfo();
@@ -279,6 +282,15 @@ class MapProc {
     public static function EnterFootHold() {
         $targetMapId = req()->paras[0];                                          # 提取参数
         $newMap = ctx()->newMap();
+        
+        if(!StlUtil::dictHasProperty($newMap->unlockedFootholds,$targetMapId)){
+            $mo = GameConfig::gate_getItem($targetMapId);
+            $footHold = new Ins_FootHold();
+            $footHold->mapId = $mo->gateId;
+            $footHold->curMapType = $mo->mapType;
+            $this->unlockedFootholds->$targetMapId = $footHold;                   # 初始化解锁新手村据点数据
+        }       
+        
         # 检查目标地图是否已经解锁
         my_Assert(isset($newMap->unlockedFootholds->$targetMapId), ErrCode::map_NotUnlocked);
         $newMap->curMapId = $targetMapId;
@@ -291,10 +303,12 @@ class MapProc {
                 $mid = $list[0];
                 break;
             }
-        } 
-        
-        $newMap->lastMapId = $mid;
+        }
         
+        if($mid != null){//更新据点id
+            $newMap->curFootholdId = $mid;
+        }
+               
         ctx()->newMap = $newMap;
         UserProc::updateUserInfo();
         return Resp::ok($newMap);

+ 2 - 0
Gameserver/Amfphp/process/StoreProc.php

@@ -460,6 +460,8 @@ class StoreProc {
 
         $store->weaponReward->$npcid->$type[] = $weaponId;
 
+        self::PutEquipInStore($weaponId);
+        
         ctx()->store = $store;
 
         UserProc::updateUserInfo();

+ 5 - 1
Gameserver/Amfphp/process/UserProc.php

@@ -339,7 +339,7 @@ class UserProc {
     /**
      * 6000 【移动端】 获取分区列表
      */
-    public static function GetZoneList() {
+    public static function GetZoneList() {        
         $defaultZone = new Ins_ZoneInfo(1, 0, "");                             # 新用户默认分区
         $bGetRecommended = false;
         if (count(req()->paras) > 0) {                                           # 是否只拉取推荐分区
@@ -507,6 +507,10 @@ class UserProc {
                 break;
             }
         }
+        
+        if(!StlUtil::dictHasProperty($game->newMap, 'curFootholdId')){
+            $game->newMap->curFootholdId = $game->newMap->curMapId;
+        }
             
     }