From fd94cf4a58cb44cc2c34e711a2d48a3ec60789ff Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期三, 17 七月 2019 17:28:08 +0800 Subject: [PATCH] 8125 子 【主干】新功能:累计充值 / 【后端】【主干】累计充值 --- ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py | 64 +++++++++++++++++++------------ 1 files changed, 39 insertions(+), 25 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py index 5801e05..5b1da6b 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py @@ -39,6 +39,7 @@ import PlayerCompensation import IpyGameDataPY import PyGameDataStruct +import CrossRealmPlayer import PyDataManager import PlayerControl import CrossRealmMsg @@ -47,10 +48,9 @@ import PlayerGeTui import IPY_GameServer import CrossBoss +import PlayerFB import time - - ''' ShareDefine.Def_UniversalGameRecType_BossInfo @@ -103,12 +103,12 @@ 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) @@ -159,13 +159,14 @@ ## 世界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: @@ -322,7 +323,19 @@ 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 @@ -483,9 +496,8 @@ 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 ## 玩家登录通知 @@ -536,9 +548,9 @@ 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') @@ -549,7 +561,11 @@ # 同步到玩家对应子服 if not serverGroupID: return - CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_DropGoodItem, msgList, [serverGroupID]) + zoneIpyData = CrossRealmPlayer.GetCrossZoneIpyDataByServerGroupID(mapID, serverGroupID) + if not zoneIpyData: + return + serverGroupIDList = zoneIpyData.GetServerGroupIDList() + CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_DropGoodItem, msgList, serverGroupIDList) return recType = ShareDefine.Def_UniversalGameRecType_BossDropGoodItemInfo @@ -579,10 +595,10 @@ 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 @@ -661,7 +677,7 @@ def SetBossRefreshTime(bossid, killedTime): '''设置boss刷新时间''' - ipyData = IpyGameDataPY.GetIpyGameData('BOSSInfo', bossid) + ipyData = IpyGameDataPY.GetIpyGameDataNotLog('BOSSInfo', bossid) if not ipyData: return onlineCnt = __GetBossOnlineHeroCnt(bossid)[0] @@ -712,6 +728,7 @@ def GetBossAttentionDict(self): return self.bossAttentionDict + # RecordData改json记录 bossid存为字符串 def UpdateBossAttention(self, playerid, bossid, isAdd): if playerid in self.bossAttentionDict: bossAttentionData = self.bossAttentionDict[playerid] @@ -753,7 +770,7 @@ 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) @@ -785,10 +802,7 @@ 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 -- Gitblit v1.8.0