| | |
| | | import PlayerGeTui
|
| | | import IPY_GameServer
|
| | | import CrossBoss
|
| | | import PlayerFB
|
| | |
|
| | | import time
|
| | |
|
| | |
|
| | |
|
| | | '''
|
| | | ShareDefine.Def_UniversalGameRecType_BossInfo
|
| | |
| | | if bossID <= 0:
|
| | | return
|
| | |
|
| | | bossID, killPlayerName, hurtValue, isNotify, realMapID, dataMapID, copyMapID, killerIDList = msgList
|
| | | bossID, killPlayerName, hurtValue, isNotify, mapID, realMapID, copyMapID, killerIDList = msgList
|
| | | mapID = PlayerFB.GetRecordMapID(mapID)
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.DoCrossBossOnKilled(bossID, killPlayerName, realMapID, dataMapID, copyMapID, killerIDList)
|
| | | CrossBoss.DoCrossBossOnKilled(bossID, killPlayerName, mapID, realMapID, copyMapID, killerIDList)
|
| | | return
|
| | |
|
| | | mapID = dataMapID
|
| | | isAddKillCnt = False
|
| | |
|
| | | isMapNeedShunt = IsMapNeedBossShunt(mapID)
|
| | |
| | | ## 世界boss状态变更
|
| | | if len(msgList) <= 0:
|
| | | return
|
| | |
|
| | | bossID, isAlive, dataMapID, realMapID, copyMapID = msgList
|
| | | |
| | | bossID, isAlive, mapID, realMapID, copyMapID = msgList
|
| | | mapID = PlayerFB.GetRecordMapID(mapID)
|
| | | if GameWorld.IsCrossServer():
|
| | | CrossBoss.DoCrossBossStateChange(bossID, isAlive, dataMapID, realMapID, copyMapID)
|
| | | CrossBoss.DoCrossBossStateChange(bossID, isAlive, mapID, realMapID, copyMapID)
|
| | | return
|
| | |
|
| | | mapID, lineID = dataMapID, copyMapID
|
| | | lineID = copyMapID
|
| | | GameWorld.Log("世界boss状态变更: mapID=%s,lineID=%s,bossID=%s,state=%s,tick=%s" % (mapID, lineID, bossID, isAlive, tick))
|
| | |
|
| | | if bossID <= 0:
|
| | |
| | | def OnQueryBossInfo(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | bossIDList = clientData.BossIDList
|
| | | Sync_BossInfo(curPlayer, bossIDList)
|
| | | if not bossIDList:
|
| | | Sync_BossInfo(curPlayer)
|
| | | CrossBoss.Sync_CrossBossInfo(curPlayer)
|
| | | return
|
| | | bossID = bossIDList[0]
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('BOSSInfo', bossID)
|
| | | if not ipyData:
|
| | | return
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | CrossBoss.Sync_CrossBossInfo(curPlayer, bossIDList)
|
| | | else:
|
| | | Sync_BossInfo(curPlayer, bossIDList)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | isAlive = __GetIsAlive(bossID)
|
| | | if not isAlive:
|
| | | continue
|
| | | mapID = ipyData.GetMapID()
|
| | | if mapID != ChConfig.Def_FBMapID_SealDemon:
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 1)
|
| | | #if mapID not in ChConfig.WorldBossFBMapIDList:
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID, 1)
|
| | | return
|
| | |
|
| | | ## 玩家登录通知
|
| | |
| | |
|
| | | def OnKillBossDropGoodItem(msgList, tick):
|
| | | # playerName, mapID, npcID, itemID, userData
|
| | | if len(msgList) != 8:
|
| | | if len(msgList) != 10:
|
| | | return
|
| | | playerID, killerName, mapID, npcID, itemID, userData, weightValue, serverGroupID = msgList
|
| | | playerID, killerName, mapID, lineID, npcID, itemID, userData, weightValue, serverGroupID, playerLV = msgList
|
| | | GameWorld.DebugLog("击杀Boss掉落好物品: mapID=%s,npcID=%s,killerName=%s,itemID=%s, userData=%s, weightValue=%s, serverGroupID=%s"
|
| | | % (mapID, npcID, killerName, itemID, userData, weightValue, serverGroupID))
|
| | | maxRecordCnt = IpyGameDataPY.GetFuncCfg('DropRecordNum')
|
| | |
| | | # 同步到玩家对应子服
|
| | | if not serverGroupID:
|
| | | return
|
| | | zoneIpyData = CrossRealmPlayer.GetServerCrossZoneIpyData(mapID, serverGroupID)
|
| | | zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByServerGroupID(mapID, serverGroupID)
|
| | | if not zoneIpyData:
|
| | | return
|
| | | serverGroupIDList = zoneIpyData.GetServerGroupIDList()
|
| | |
| | | if commonList and commonList[0][0] != -1:
|
| | | recordList.Delete(commonList[0][0])
|
| | |
|
| | | PlayerUniversalGameRec.MapServer_UniversalGameRec(None, recType, [mapID, npcID, itemID, playerID, weightValue],
|
| | | [killerName, "", userData])
|
| | | PlayerUniversalGameRec.MapServer_UniversalGameRec(None, recType, [mapID*100+lineID, npcID, itemID, playerID, weightValue],
|
| | | [killerName, '%s|%s'%(serverGroupID, playerLV), userData])
|
| | |
|
| | | msgList = [killerName, playerID, mapID, npcID, itemID, userData]
|
| | | msgList = [killerName, playerID, mapID, npcID, itemID, userData, serverGroupID, playerLV, lineID]
|
| | | PlayerControl.WorldNotify(0, 'DropRecord' , msgList)
|
| | | return
|
| | |
|
| | |
| | | def GetBossAttentionDict(self):
|
| | | return self.bossAttentionDict
|
| | |
|
| | | # RecordData改json记录 bossid存为字符串
|
| | | def UpdateBossAttention(self, playerid, bossid, isAdd):
|
| | | if playerid in self.bossAttentionDict:
|
| | | bossAttentionData = self.bossAttentionDict[playerid]
|
| | |
| | | packData.BossList = []
|
| | | for bossid, addState in bttentionDict.items():
|
| | | bossInfo = ChPyNetSendPack.tagGCBossAttention()
|
| | | bossInfo.BossID=bossid
|
| | | bossInfo.BossID=int(bossid)
|
| | | bossInfo.AddState=addState
|
| | | packData.BossList.append(bossInfo)
|
| | |
|
| | |
| | | data.clear()
|
| | | pos += data.readData(datas, pos, dataslen)
|
| | | playerID = data.PlayerID
|
| | | if type(eval(data.RecordData)) != list:
|
| | | self.bossAttentionDict[playerID] = data
|
| | | else:
|
| | | data.clear()
|
| | | self.bossAttentionDict[playerID] = data
|
| | |
|
| | | return pos
|
| | |
|