| | |
| | |
|
| | | import GameWorld
|
| | | import ShareDefine
|
| | | import QuestManager
|
| | | import EventShell
|
| | | import ChConfig
|
| | |
|
| | | import sys
|
| | |
| | |
|
| | | GameWorld.Log("开始脚本重读 curVersion=%s,updVersion=%s" % (curVersion, updVersion))
|
| | | moduleNameDict = {}
|
| | | isReloadMission = False
|
| | |
|
| | | for moduleKey, module in sys.modules.items():
|
| | | if "py" not in str(module):
|
| | |
| | | if curModuleName in moduleNameDict:
|
| | | for moduleKey in moduleNameDict[curModuleName]:
|
| | | __DoModuleReload(moduleKey)
|
| | | |
| | | if curModuleName in ["QuestCommon", "QuestManager", "QuestRunner"]:
|
| | | isReloadMission = True
|
| | |
|
| | | # 判断脚本文件是否有修改,如有修改则进行重读任务
|
| | | |
| | | # 重读任务可能有一定风险,需详细测试
|
| | | if isReloadMission:
|
| | | QuestManager.ReloadQuests(tick)
|
| | | EventShell.DoReloadRefresh()
|
| | |
|
| | | GameWorld.Log(" 脚本重读 OK! isReloadMission=%s" % isReloadMission) |
| | | GameWorld.Log(" 脚本重读 !") |
| | | return
|
| | |
|
| | | def __DoModuleReload(moduleKey):
|