| | |
| | | import PyGameData
|
| | | import PlayerGeTui
|
| | | import IPY_GameServer
|
| | | import CrossBoss
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | if bossID <= 0:
|
| | | return
|
| | |
|
| | | # 设置不存活,击杀玩家名
|
| | | killPlayerName = msgList[1]
|
| | | hurtValue = msgList[2]
|
| | | isAddKillCnt = msgList[3]
|
| | | isNotify = msgList[4] if len(msgList) > 4 else True
|
| | | mapID = msgList[5] if len(msgList) > 5 else None
|
| | | bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID = msgList
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID)
|
| | | return
|
| | | |
| | | mapID = dataMapID
|
| | | isAddKillCnt = False
|
| | |
|
| | | isMapNeedShunt = IsMapNeedBossShunt(mapID)
|
| | | isAlive = __GetIsAlive(bossID)
|
| | |
| | | if len(msgList) <= 0:
|
| | | return
|
| | |
|
| | | bossID = msgList[0]
|
| | | isAlive = msgList[1]
|
| | | mapID = msgList[2] if len(msgList) > 2 else None
|
| | | lineID = msgList[3] if len(msgList) > 3 else None
|
| | | bossID, isAlive, dataMapID, realMapID, copyMapID = msgList
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.DoCrossBossStateChange(bossID, isAlive, dataMapID, realMapID, copyMapID)
|
| | | return
|
| | | |
| | | mapID, lineID = dataMapID, copyMapID
|
| | | GameWorld.Log("世界boss状态变更: mapID=%s,lineID=%s,bossID=%s,state=%s,tick=%s" % (mapID, lineID, bossID, isAlive, tick))
|
| | |
|
| | | if bossID <= 0:
|
| | |
| | | recTypeListData = __GetBossPrizeRecData()
|
| | | # 查找是否已有记录
|
| | | bossRec = None
|
| | | for index in range(recTypeListData.Count()):
|
| | | for index in xrange(recTypeListData.Count()):
|
| | | universalRecData = recTypeListData.At(index)
|
| | | if universalRecData.GetValue1() == bossID:
|
| | | bossRec = universalRecData
|
| | |
| | | recTypeListData = __GetBossPrizeRecData()
|
| | | bossInfo.BossInfoList = []
|
| | | #GameWorld.DebugLog("Sync_BossInfo...count=%s,curTime=%s" % (recTypeListData.Count(), curTime))
|
| | | for index in range(recTypeListData.Count()):
|
| | | for index in xrange(recTypeListData.Count()):
|
| | | universalRecData = recTypeListData.At(index)
|
| | | bossID = universalRecData.GetValue1()
|
| | | if not bossID:
|
| | | continue
|
| | | if syncBOSSIDList and bossID not in syncBOSSIDList:
|
| | | continue
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('BOSSInfo', bossID)
|
| | | if not ipyData:
|
| | | continue
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | continue
|
| | | bossInfoObj = ChPyNetSendPack.tagBossInfoObj()
|
| | | bossInfoObj.BossID = bossID
|
| | |
| | | if not curPlayer:
|
| | | # 全服广播在线玩家
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in range(0, playerManager.GetActivePlayerCount()):
|
| | | for i in xrange(playerManager.GetActivePlayerCount()):
|
| | | curPlayer = playerManager.GetActivePlayerAt(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | |
| | | if not GameWorld.SetWorldDictKey(ChConfig.TYPE_WorldBossProcessTick, tick):
|
| | | #间隔未到
|
| | | return
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.DoCheckCrossBossReborn(tick)
|
| | | return
|
| | | curTime = int(time.time())
|
| | | DoCheckWorldBossShuntInfo(curTime, tick)
|
| | | BossRebornWorldNotify(curTime)
|
| | |
| | | for i in xrange(IpyGameDataPY.IPY_Data().GetBOSSInfoCount()):
|
| | | ipyData = IpyGameDataPY.IPY_Data().GetBOSSInfoByIndex(i)
|
| | | bossID = ipyData.GetNPCID()
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | continue
|
| | | bossPrizeRec = __GetBossRecDataByID(bossID)
|
| | | killedTime = bossPrizeRec.GetValue2()
|
| | | refreshTime = __GetBossRefreshTime(bossID)
|
| | |
| | | if not GameWorld.SetWorldDictKey(ChConfig.TYPE_WorldBossGeTuiTick, tick):
|
| | | #间隔未到
|
| | | return
|
| | | |
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | curTime = int(time.time())
|
| | | for bossInfo in PyGameData.g_sortBOSSRefreshList:
|
| | | bossID, killedTime, refreshTime = bossInfo
|
| | |
| | | for i in xrange(IpyGameDataPY.IPY_Data().GetBOSSInfoCount()):
|
| | | ipyData = IpyGameDataPY.IPY_Data().GetBOSSInfoByIndex(i)
|
| | | bossID = ipyData.GetNPCID()
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | continue
|
| | | isAlive = __GetIsAlive(bossID)
|
| | | if not isAlive:
|
| | | continue
|
| | |
| | | # @param curPlayer
|
| | | # @return None
|
| | | def OnPlayerLogin(curPlayer):
|
| | | CrossBoss.OnPlayerLogin(curPlayer)
|
| | | Sync_BossInfo(curPlayer)
|
| | | PyDataManager.GetBossAttentionManager().NotifyBossAttentionInfo(curPlayer)
|
| | | if IsMapNeedBossShunt(0):
|
| | |
| | | # @param None
|
| | | # @return None
|
| | | def OnMapServerInitOK():
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.OnCrossMapServerInitOK()
|
| | | return
|
| | | SendMapServerBossKilledCnt()
|
| | | __SendMapServerAliveBoss()
|
| | | if IsMapNeedBossShunt(0):
|
| | |
| | | if not GameWorld.SetWorldDictKey(ChConfig.TYPE_WorldBossOnlineCntTick, tick):
|
| | | #间隔未到
|
| | | return
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GameWorld.DebugLog('世界boss在线人数统计')
|
| | | bossRebornDict = {}
|
| | | for i in xrange(IpyGameDataPY.IPY_Data().GetBOSSInfoCount()):
|
| | | ipyData = IpyGameDataPY.IPY_Data().GetBOSSInfoByIndex(i)
|
| | | bossID = ipyData.GetNPCID()
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | continue
|
| | | refreshTimeStr = ipyData.GetRefreshTime()
|
| | | if 'onlineCnt' in refreshTimeStr:
|
| | | bossRebornDict[bossID] = ipyData.GetLVLimit()
|