From 06000a31bd6d8f35635aa93f883e37c3af69d23a Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 01 七月 2022 14:55:26 +0800 Subject: [PATCH] 1111 【主干】【bt7】【yn_1.0.1】【yn_ver1】 切图封包A126 A127通知dataMapID --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py index e9c753f..e40aa0a 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py @@ -908,6 +908,33 @@ def GetMap(): return __GameWorld.GetMap() +def GetMapDataMapID(mapID): + ## 用于获取非本地图的dataMapID,仅针对 ZoneServerGroup\map1_8G\MapServer\MapServerData\Map\MapID.txt + mapIDTxtInfo = GetMapIDTxtInfo() + if mapID not in mapIDTxtInfo: + return mapID + mapInfo = mapIDTxtInfo[mapID] + dataMapID = mapInfo.get("DataMapID", mapID) + return dataMapID + +def GetMapIDTxtInfo(): + if PyGameData.g_mapIDTxtInfo: + return PyGameData.g_mapIDTxtInfo + PyGameData.g_mapIDTxtInfo = {} + rootPath = ChConfig.GetServerRootPath() + mapIDTxt = rootPath + "\\ZoneServerGroup\\map1_8G\\MapServer\\MapServerData\\Map\\MapID.txt" + f = open(mapIDTxt) + for line in f.readlines(): + lineList = line.split('\t') + if not lineList or len(lineList) < 9: + continue + tMapID = int(lineList[1]) + dDataMapID = int(lineList[3]) + PyGameData.g_mapIDTxtInfo[tMapID] = {"DataMapID":dDataMapID} + Log("Load %s" % mapIDTxt) + Log("g_mapIDTxtInfo=%s" % PyGameData.g_mapIDTxtInfo) + return PyGameData.g_mapIDTxtInfo + #--------------------------------------------------------------------- ##获取Mail实例 # @param 无 -- Gitblit v1.8.0