hxp
2022-11-16 7e17abc560ec66bc164e5e1f8deff42e96ca8af8
9750 【BT7】【越南】【主干】【服务端】服务器无人登录警告
3个文件已修改
22 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldProcess.py
@@ -358,6 +358,7 @@
def GameWorldProcessOnMinute(curMinute, tick):
    # 每整分钟触发一次
    CheckServerHasPlayerLoginAfterInitOK()
    #检查服务器正式开服
    DoCheckNewServerOpen(tick)
    #回报数据库当前在线玩家数
@@ -389,6 +390,24 @@
        
    return
def CheckServerHasPlayerLoginAfterInitOK():
    ## 检查服务器启动成功后是否有玩家正常登录
    initGameWorldTime = GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit)
    if not initGameWorldTime:
        return
    if PyGameData.g_noPlayerLoginWarningMailState:
        return
    curTime = int(time.time())
    noPlayerLoginWarningTimes = IpyGameDataPY.GetFuncCfg("ServerEvent", 1) * 60 # x分钟没有玩家登录则预警
    if curTime - initGameWorldTime < noPlayerLoginWarningTimes:
        return
    GameWorld.SendGameError("NoPlayerLogin")
    PyGameData.g_noPlayerLoginWarningMailState = 1
    return
def OnReloadConfig():
    return
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -244,6 +244,7 @@
    if isMixServerFirstLogin:
        PlayerCharm.OnMixServerFirstLogin(curPlayer)
        
    PyGameData.g_noPlayerLoginWarningMailState = 2
    return
def __UpdOnedayJobPlayerLoginoffTime(curPlayer):
ServerPython/CoreServerGroup/GameServer/Script/PyGameData.py
@@ -16,6 +16,8 @@
g_allMapServerInitOK = False
g_noPlayerLoginWarningMailState = 0 # 服务器启动后无玩家登录预警邮件状态; 0-未处理;1-已发送;2-有玩家登录了
g_pyGameDataManager = None
g_commMapLineInfo = {} # 地图线路真实地图虚拟线信息 {(dataMapID, lineID):(realMapID, copyMapID), ...}