| | |
| | | ## 标记重读配置
|
| | | global PyMongoDataServerConfig
|
| | | global ServersRouteConfig
|
| | | global ServersConfigDict
|
| | |
|
| | | GameWorld.Log("=== 设置重读配置 ===")
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_ReloadConfig, 1)
|
| | | PyMongoDataServerConfig = None
|
| | | ServersRouteConfig = None
|
| | | ServersConfigDict = {}
|
| | | OnReloadServersConfig()
|
| | | IpyGameDataPY.IPYData.IpyDataClear()
|
| | | import DataRecordPack
|
| | | DataRecordPack.DR_Reload("config")
|
| | | OnReloadConfig()
|
| | | return
|
| | |
|
| | | def OnReloadServersConfig():
|
| | | global ServersConfigDict
|
| | | ServersConfigDict = {}
|
| | | GetServerConfigDict()
|
| | | import DataRecordPack
|
| | | DataRecordPack.DR_Reload("ServersConfig")
|
| | | return
|
| | |
|
| | | def OnReloadConfig():
|
| | |
| | | GameWorld.Log('无法找到文件 = %s'%(filePath))
|
| | | raise Exception('无法找到文件 = %s'%(filePath))
|
| | |
|
| | | batFilePath = ChConfig.GetServersRoutePath() + "\\Config\\BattleServer.json"
|
| | | if not os.path.isfile(batFilePath):
|
| | | GameWorld.Log('无法找到文件 = %s'%(batFilePath))
|
| | | raise Exception('无法找到文件 = %s'%(batFilePath))
|
| | | |
| | | f = open(filePath, 'r')
|
| | | strMsg = f.read()
|
| | | serverDict = eval(f.read())
|
| | | f.close()
|
| | |
|
| | | ServersConfigDict = eval(strMsg)
|
| | | f = open(batFilePath, 'r')
|
| | | batServerDict = eval(f.read())
|
| | | f.close()
|
| | | |
| | | groupName = GameWorld.GetServerGroupName()
|
| | | ServersConfigDict = {}
|
| | | ServersConfigDict = {int(k):v for k, v in serverDict.items()}
|
| | | for batServerID, mapID in batServerDict.items():
|
| | | if batServerID in ServersConfigDict:
|
| | | continue
|
| | | ServersConfigDict[batServerID] = [groupName, mapID, ShareDefine.serverType_Battle]
|
| | | GameWorld.Log("Load ServersConfigDict=%s" % ServersConfigDict)
|
| | |
|
| | | return ServersConfigDict
|
| | |
|