Browse Source

回城券接口修改

cyzhao 3 years ago
parent
commit
c9c1cf5782

+ 2 - 2
Gameserver/Amfphp/base/CmdCode.php

@@ -1385,12 +1385,12 @@ class CmdCode {
     /*
      * 回城券使用
      */
-    public const cmd_store_huichengQuanUse = 7507;
+    public const map_huichengQuanUse = 7507;
     
     /*
      * 回城券传送阵消失
      */
-    public const cmd_store_huichengQuanEnd = 7508;
+    public const map_huichengQuanEnd = 7508;
     
 // 
 // // </editor-fold>

+ 17 - 1
Gameserver/Amfphp/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-13 09:54:52
+ // 日期: 2022-04-24 15:45:06
 ////////////////////
 
 namespace loyalsoft;
@@ -1738,6 +1738,22 @@ class GameConfig {
         return self::get_hash_item('shop_supplies', $npc)->$items;
     }
     /**
+    * 区域不同
+    * @return \map_scene_zoneid
+    */
+    public static function map_scene_zoneid()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'map_scene_zoneid');
+    }
+    /**
+    * @return \sm_map_scene_zoneid map_scene_zoneid itemArray 
+    */
+    public static function map_scene_zoneid_getItemArray($key)
+    { 
+        return self::get_hash_item('map_scene_zoneid', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2022-04-21 14:20:51
+ // 日期: 2022-04-24 15:45:06
 ////////////////////
 
 /**
@@ -1736,6 +1736,22 @@ class GameConfig {
         return self::get_hash_item('shop_supplies', $npc)->$items;
     }
     /**
+    * 区域不同
+    * @return \map_scene_zoneid
+    */
+    public static function map_scene_zoneid()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'map_scene_zoneid');
+    }
+    /**
+    * @return \sm_map_scene_zoneid map_scene_zoneid itemArray 
+    */
+    public static function map_scene_zoneid_getItemArray($key)
+    { 
+        return self::get_hash_item('map_scene_zoneid', $key);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 62 - 0
Gameserver/Amfphp/model/Const/sm_map_scene_zoneid.php

@@ -0,0 +1,62 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2022-03-18 10:38:27
+////////////////////
+
+
+/**
+ * Static Model map_scene_zoneid 区域不同
+ */
+class sm_map_scene_zoneid
+{
+
+    /**
+    * @var Int32 据点场景编号  
+    */
+    public $mapId;
+
+    /**
+    * @var String 据点名称  
+    */
+    public $name;
+
+    /**
+    * @var Int32 场景类型: 城镇0/据点1/非据点2/Boss点3/  
+    */
+    public $mapType;
+
+    /**
+    * @var Int32 据点所属区域ID  
+    */
+    public $zoneId;
+
+    /**
+    * @var String 在小地图上的图标  
+    */
+    public $icon;
+
+    /**
+    * @var String 据点描述信息  
+    */
+    public $desc;
+
+    /**
+    * @var String 怪物等级信息  
+    */
+    public $monsterLevel;
+
+    /**
+    * @var String 怪物特性信息  
+    */
+    public $monsterAttr;
+
+    /**
+    * @var String 探索完成奖励数据(itemid,num;itemid,num;...)  
+    */
+    public $exploreReward;
+
+}
+

+ 21 - 10
Gameserver/Amfphp/process/MapProc.php

@@ -29,9 +29,9 @@ class MapProc {
                 return self::unlockInfoSva();
             case CmdCode::map_reviceExplorerReward:                             #  [7506] 领取探索奖励cmd_store_huichengQuanUse
                 return self::reviceExplorerReward();
-            case CmdCode::cmd_store_huichengQuanUse:                            #  [7507] 
+            case CmdCode::map_huichengQuanUse:                                  #  [7507] 
                 return self::huichengQuanUse();
-            case CmdCode::cmd_store_huichengQuanEnd:                            #  [7508] 
+            case CmdCode::map_huichengQuanEnd:                                  #  [7508]
                 return self::huichengQuanEnd();
             default:                                                            #  err: 未知的命令码
                 return Resp::err(ErrCode::cmd_err);
@@ -42,12 +42,21 @@ class MapProc {
      * @return Resp
      */
     public static function huichengQuanUse() {
-        $itemId = req()->paras[0];                                              # 提取参数		                                       
+        $mapId = req()->paras[0];
+        $itemId = req()->paras[1];                                              # 提取参数		                                       
         $newMap = ctx()->newMap(true);
      
         StoreProc::removeItemFromStore(ctx()->store, $itemId);
+       
+        $zoneId = GameConfig::map_scene_getItem($mapId)->zoneId;
+        $dic = GameConfig::map_scene();
+        my_Assert($dic != null, ErrCode::err_const_no);
+        
+        $item = GameConfig::map_scene_zoneid_getItemArray($zoneId)[0];        
+        
+        $newMap->curMapId = $item->mapId;       
+        $newMap->huichengquanRecord[] = $item->mapId;
         
-        $newMap->huichengquanRecord[] = 1;
         ctx()->newMap = $newMap;
 
         UserProc::updateUserInfo();
@@ -57,17 +66,19 @@ class MapProc {
     }
     
     /**
-     * [7508]
+     * [7508] 回城券的传送阵结束 
      * @return Resp
      */
     public static function huichengQuanEnd() {
-        //$mapid = req()->paras[0];                                               # 提取参数		                                       
+        $mapid = req()->paras[0];                                               # 提取参数		                                       
         $newMap = ctx()->newMap();
-        $zoneid = 1;
-        my_Assert(in_array($zoneid,$newMap->huichengquanRecord), ErrCode::map_NotChuanSongZhen);
+        //$initMapid = 1001;
+//        my_Assert(in_array($mapid,$newMap->huichengquanRecord), ErrCode::map_NotChuanSongZhen);
 
-        StlUtil::arrayRemove($newMap->huichengquanRecord, $zoneid);
-              
+        if(in_array($mapid, $newMap->huichengquanRecord)){
+            StlUtil::arrayRemove($newMap->huichengquanRecord, $mapid);
+        }
+                     
         ctx()->newMap = $newMap;
 
         UserProc::updateUserInfo();