From 70c43a79d99c93fc5fe8976006ca1a8a1570a0f5 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 25 十月 2021 12:07:52 +0800
Subject: [PATCH] 9302 【BT5】【主干】【后端】GameServer启动慢后续优化处理
---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py | 9 +++++++++
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
index 4912bed..7c78d32 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -1265,6 +1265,11 @@
AuctionHouse.OnGameServerInitOK()
# 注意:跨服相关信息的调用需放在最后,不然可能导致服务器未启动功能或者功能未加载成功导致跨服服务器与子服之间的数据同步可能出现异常的情况
CrossRealmMsg.OnGameServerInitOK()
+ if PyGameData.g_allMapServerInitOK:
+ GameWorld.Log("InitGameWorld时AllMapServerInitOK已触发则补触发一次!")
+ GameWorld.SendGameError("GameWarning", "InitGameWorld later than AllMapServerInitOK")
+ AllMapServerInitOK(tick)
+
return
def DoCheckNewServerOpen(tick):
@@ -1354,6 +1359,10 @@
# @return None
# @remarks 当一个mapServer开启时,
def AllMapServerInitOK(tick):
+ PyGameData.g_allMapServerInitOK = True
+ if not GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit):
+ GameWorld.Log("AllMapServerInitOK时GameServer还未启动好!")
+ return
#通知所有地图服务器初始化成功, 同步时间
GameWorld.GetGameWorld().Notify_AllMapServerInitOK(GameWorld.GetCurrentDataTimeStr())
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
index d9ed3f2..142aca7 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -12,6 +12,8 @@
#
#---------------------------------------------------------------------
+g_allMapServerInitOK = False
+
g_pyGameDataManager = None
g_commMapLineInfo = {} # 地图线路真实地图虚拟线信息 {(dataMapID, lineID):(realMapID, copyMapID), ...}
--
Gitblit v1.8.0