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 无 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -2218,7 +2218,7 @@ curPlayer.SetVisible(False) sendPack = ChPyNetSendPack.tagMCPrepareChangeMap() sendPack.Clear() sendPack.MapID = sceneMapID sendPack.MapID = GameWorld.GetMapDataMapID(sceneMapID) sendPack.FuncLineID = funcLineID NetPackCommon.SendFakePack(curPlayer, sendPack) @@ -2229,7 +2229,7 @@ def NotifyStartChangeMap(curPlayer): sendPack = ChPyNetSendPack.tagMCStartChangeMap() sendPack.Clear() sendPack.MapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ChangeMapID) sendPack.MapID = GameWorld.GetMapDataMapID(curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ChangeMapID)) sendPack.FuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine) NetPackCommon.SendFakePack(curPlayer, sendPack) ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -14,6 +14,8 @@ #------------------------------------------------------------------------------- #"""Version = 2017-09-05 21:30""" #------------------------------------------------------------------------------- g_mapIDTxtInfo = {} # MapID.txt 加载的信息 g_commMapLinePlayerCountDict = {} # 常规地图分线人数 {mapID:{lineID:人数, ...}} g_needRefreshMapServerState = True # 常规地图分线人数是否有变更需要通知 g_mapLastProcess_Minute = -1 # 地图上次处理的分钟