| | |
| | | import IpyGameDataPY
|
| | | import ChPyNetSendPack
|
| | | import CrossRealmPlayer
|
| | | import DataRecordPack
|
| | | #import DataRecordPack
|
| | | import PlayerControl
|
| | | import NetPackCommon
|
| | | import CrossRealmMsg
|
| | |
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | Sync_CrossBossInfo(curPlayer)
|
| | | __LoginNotifyKillCrossBoss(curPlayer)
|
| | | return
|
| | |
|
| | | def CrossServerMsg_CrossBossInfo(bossInfoDict):
|
| | |
| | | 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"})
|
| | | #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):
|
| | | ## 收到跨服服务器同步的跨服boss状态
|
| | |
|