From 9471febd32f98a234dbffd836cdf1f02188b02d9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 25 十二月 2025 15:51:38 +0800
Subject: [PATCH] 16 卡牌服务端(战斗服务器后台重读支持;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ReadChConfig.py | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ReadChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ReadChConfig.py
index b396ced..c122de1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ReadChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ReadChConfig.py
@@ -40,6 +40,7 @@
AllChConfig = {}
GeneralProgramme = {}
+ServersRouteConfig = None
PyMongoDataServerConfig = None
DBAllChConfig = {}
@@ -103,6 +104,8 @@
GameWorld.Log("=== 设置重读配置 ===")
GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_ReloadConfig, 1)
IpyGameDataPY.IPYData.IpyDataClear()
+ import DataRecordPack
+ DataRecordPack.DR_Reload("config")
return
## 重读,清除配置
@@ -112,6 +115,7 @@
global AllChConfig
global GeneralProgramme
global PyMongoDataServerConfig
+ global ServersRouteConfig
global DBAllChConfig
#重读所有的配置表
@@ -119,6 +123,7 @@
GeneralProgramme = {}
FormulaControl.ClearCompileFormulaDist()
PyMongoDataServerConfig = None
+ ServersRouteConfig = None
DBAllChConfig = {}
GameWorld.Log('MapServer_Reload_ChConfig')
@@ -215,6 +220,30 @@
## -----------------------------------------------------------
+def GetServersRouteConfig(section, option, raw=False, defaultValue=None, isLog=True):
+ global ServersRouteConfig
+
+ if not ServersRouteConfig:
+ filePath = ChConfig.GetServersRoutePath() + "\\PyMongoDataServer.ini"
+
+ if not os.path.isfile(filePath):
+ GameWorld.Log('无法找到文件 = %s'%(filePath))
+ raise Exception('无法找到文件 = %s'%(filePath))
+
+ ServersRouteConfig = ConfigParser.ConfigParser()
+ ServersRouteConfig.read(filePath)
+ GameWorld.DebugLog("Reload %s" % str(filePath))
+
+ if not ServersRouteConfig.has_option(section, option):
+ if defaultValue != None:
+ return defaultValue
+ if isLog:
+ GameWorld.ErrLog("ServersRoute->PyMongoDataServer.ini找不到配置: section=%s,option=%s" % (section, option))
+ return ""
+
+ strParam = ServersRouteConfig.get(section, option, raw)
+ return strParam
+
## PyMongoDataServer.ini配置读取
# @param section: 分段区块名
# @param option: 配置项名
--
Gitblit v1.8.0