Browse Source

调试修改bug

cyzhao 3 years ago
parent
commit
9366e2ec98

+ 3 - 2
Gameserver/Amfphp/model/User/Info_NewMap.php

@@ -33,7 +33,7 @@ class Info_NewMap extends Object_ext {
      * 回城券使用的传送阵记录
      * @var type
      */
-    public $huichengquanRecord = array();
+    public $huichengquanRecord = null;
     
     function __construct($arg = null) {
         if (null === $arg) {
@@ -57,7 +57,8 @@ class Info_NewMap extends Object_ext {
             $footHold->curMapType = $mo->mapType;
             $this->unlockedFootholds->$initMapid = $footHold;                   # 初始化解锁新手村据点数据
             
-            $this->unlockMapTypeList = ObjectInit();                            #初始化--已经解锁的地图上的区域、npc、道具等等信息                                      #
+            $this->unlockMapTypeList = ObjectInit();                            #初始化--已经解锁的地图上的区域、npc、道具等等信息      
+            $this->huichengquanRecord = ObjectInit();                                #
         } else {
             parent::__construct($arg);
         }

+ 38 - 0
Gameserver/Amfphp/model/User/Ins_ChuansongzhenMapData.php

@@ -0,0 +1,38 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+namespace loyalsoft;
+
+/**
+ * Description of Ins_ChuansongzhenMapData
+ *
+ * @author c'y'zhao
+ */
+class Ins_ChuansongzhenMapData extends Object_ext{
+    /**
+     * @var int 使用传送门的场景的地图id
+     */
+    public $lastMapId;
+
+    /**
+     * @var float 具体位置 x
+     */
+    public $position_x;
+    
+    /**
+     * 具体位置 y
+     * @var float
+     */
+    public $position_y;
+    
+    /**
+     * 具体位置 z
+     * @var float
+     */
+    public $position_z;
+}

+ 20 - 11
Gameserver/Amfphp/process/MapProc.php

@@ -42,10 +42,12 @@ class MapProc {
      * @return Resp
      */
     public static function huichengQuanUse() {
-//        $mapId = req()->paras[0];
-        //$itemId = req()->paras[1];                                              # 提取参数		                                       
+        $mapId = req()->paras[0]; #使用传送门的场景的地图id
+        $x = req()->paras[1];                                              # 提取参数	
+        $y = req()->paras[2];      
+        $z = req()->paras[3];      
         $newMap = ctx()->newMap(true);   
-        $mapId = $newMap->curMapId;
+        $curMapId = $newMap->curMapId;
         
         $itemId = 0;
         $dic = ctx()->store()->items;
@@ -60,12 +62,19 @@ class MapProc {
         
         StoreProc::removeItemFromStore(ctx()->store, $itemId);
        
-        $zoneId = GameConfig::map_scene_getItem($mapId)->zoneId;
-  
+        $zoneId = GameConfig::map_scene_getItem($curMapId)->zoneId;
         $item = GameConfig::map_scene_zoneid_getItemArray($zoneId)[0];        
+        $mid = $item->mapId;
+        
+        $newMap->curMapId = $mid; 
         
-        $newMap->curMapId = $item->mapId;       
-        $newMap->huichengquanRecord[] = $item->mapId;
+        $data = new Ins_ChuansongzhenMapData();
+        $data->lastMapId = $mapId;
+        $data->position_x = $x;
+        $data->position_y = $y;
+        $data->position_z = $z;
+        
+        $newMap->huichengquanRecord->$mid = $data;
         
         ctx()->newMap = $newMap;
 
@@ -85,11 +94,11 @@ class MapProc {
         $curMapId = $newMap->curMapId;
         $zoneId = GameConfig::map_scene_getItem($curMapId)->zoneId;
 
-        $item = GameConfig::map_scene_zoneid_getItemArray($zoneId)[0];  
-        
+        $item = GameConfig::map_scene_zoneid_getItemArray($zoneId)[0];         
         $lastMapid = $item->mapId;
-        if(in_array($lastMapid, $newMap->huichengquanRecord)){
-            StlUtil::arrayRemove($newMap->huichengquanRecord, $lastMapid);
+                
+        if(StlUtil::dictHasProperty($newMap->huichengquanRecord, $lastMapid)){           
+            StlUtil::dictRemove($newMap->huichengquanRecord, $lastMapid);
         }
                      
         ctx()->newMap = $newMap;

+ 8 - 0
Gameserver/Amfphp/process/UserProc.php

@@ -436,6 +436,14 @@ class UserProc {
         if($game->store->battleItem == null){
             $game->store->battleItem = ObjectInit();
         }
+        
+        if(!StlUtil::dictHasProperty($game->newMap,'huichengquanRecord')){
+            $game->newMap->huichengquanRecord = ObjectInit();
+        }
+        
+        if(is_array($game->newMap->huichengquanRecord)){
+            $game->newMap->huichengquanRecord = ObjectInit();
+        }
     }
 
     /**