From ca4cedac152f6de34e3f612003ea784c0cceca3f Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 23 八月 2024 11:16:08 +0800 Subject: [PATCH] 10229 【越南】【主干】【港台】【砍树】古神战场修改(修复查询玩家相关队伍返回的队伍信息申请数据为空的bug;) --- ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py index 75b1354..ddaceb7 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/CrossBoss.py @@ -20,7 +20,7 @@ import IpyGameDataPY import ChPyNetSendPack import CrossRealmPlayer -import DataRecordPack +#import DataRecordPack import PlayerControl import NetPackCommon import CrossRealmMsg @@ -357,6 +357,7 @@ def OnPlayerLogin(curPlayer): Sync_CrossBossInfo(curPlayer) + __LoginNotifyKillCrossBoss(curPlayer) return def CrossServerMsg_CrossBossInfo(bossInfoDict): @@ -392,13 +393,31 @@ for playerID in killerIDList: killer = GameWorld.GetPlayerManager().FindPlayerByID(playerID) if not killer: - GameWorld.ErrLog("击杀跨服boss时主服玩家不在线, playerID=%s,mapID=%s,bossID=%s" % (playerID, mapID, bossID)) - DataRecordPack.SendEventPack("CrossBoss_Error", {"PlayerID":playerID, "Error":"MainServerOffline"}) + #GameWorld.ErrLog("击杀跨服boss时主服玩家不在线, playerID=%s,mapID=%s,bossID=%s" % (playerID, mapID, bossID)) + #DataRecordPack.SendEventPack("CrossBoss_Error", {"PlayerID":playerID, "Error":"MainServerOffline"}) + killTime = int(time.time()) + PyGameData.g_unNotifyKillCrossBossDict[playerID] = [killTime, mapID, bossID] continue msgInfo = str([mapID, bossID]) killer.MapServer_QueryPlayerResult(0, 0, "CrossKillBoss", msgInfo, len(msgInfo)) Sync_CrossBossInfo(None, syncBOSSIDList) + return + +def __LoginNotifyKillCrossBoss(curPlayer): + ## 登录时通知未通知到的击杀跨服boss + playerID = curPlayer.GetPlayerID() + if playerID not in PyGameData.g_unNotifyKillCrossBossDict: + return + killTime, mapID, bossID = PyGameData.g_unNotifyKillCrossBossDict.pop(playerID) + curTime = int(time.time()) + passSeconds = curTime - killTime + if passSeconds >= 120: + GameWorld.DebugLog("超过120秒上线不处理,主要为了防刷上线捡物品!", playerID) + return + msgInfo = str([mapID, bossID]) + curPlayer.MapServer_QueryPlayerResult(0, 0, "CrossKillBoss", msgInfo, len(msgInfo)) + GameWorld.Log("上线补通知击杀跨服boss: passSeconds=%s, mapID=%s, bossID=%s" % (passSeconds, mapID, bossID), playerID) return def CrossServerMsg_CrossBossState(msgInfo): @@ -422,7 +441,7 @@ def Sync_CrossBossInfo(curPlayer=None, syncBOSSIDList=[]): ## 同步boss相关信息 - curTime = int(time.time()) + curTime = GameWorld.ChangeTimeStrToNum(GameWorld.GetCrossServerTimeStr()) recTypeListData = GameWorld.GetUniversalRecMgr().GetTypeList(ShareDefine.Def_UniversalGameRecType_CrossBossInfo) @@ -447,6 +466,9 @@ bossInfoObj.RefreshCD = refreshTime bossInfo.BossInfoList.append(bossInfoObj) + if not bossInfo.BossInfoList: + return + bossInfo.BossCnt = len(bossInfo.BossInfoList) if not curPlayer: # 全服广播在线玩家 -- Gitblit v1.8.0