hxp
2022-03-29 b69e96ca763f96a697351e2c6cd570018d7f4605
9415 【BT】【后端】古神战场(增加战场结算信息流向记录)
1个文件已修改
21 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -24,6 +24,7 @@
import PlayerActivity
import GameWorldProcess
import NPCCustomRefresh
import DataRecordPack
import PlayerControl
import ShareDefine
import SkillCommon
@@ -86,6 +87,7 @@
class BattleWorld():
    
    def __init__(self):
        self.startTime = int(time.time())
        self.hmNum = 0
        self.callOpenPlayerInfo = {} # 本场次购买召集的玩家信息 {playerID:faction, ...}
        self.superItemInfo = [] # 大奖信息 [物品ID,个数,是否拍品]
@@ -1662,6 +1664,12 @@
        allCallPlayerIDList.extend(callTeam["callPlayerIDList"])
    GameWorld.Log("zoneID=%s,hmNum=%s,allCallPlayerIDList=%s" % (zoneID, hmNum, allCallPlayerIDList), fbPropertyID)
    
    gameWorld = GameWorld.GetGameWorld()
    drDict = {"mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":gameWorld.GetCopyMapID(),
              "zoneID":zoneID, "funcLineID":funcLineID, "fbPropertyID":fbPropertyID, "hmNum":hmNum,
              "superItemInfo":worldObj.superItemInfo, "finalSuperItemPlayerID":finalSuperItemPlayerID,
              "crystalFactionInfo":worldObj.crystalFactionInfo, "callTeamInfo":callTeamInfo,
              "winnerFaction":winnerFaction, "fightTimeTotal":(int(time.time()) - worldObj.startTime)}
    factionInfoList = []
    for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
        factionObj = GetBattleFactionObj(faction)
@@ -1701,6 +1709,7 @@
            scoreKingObj = GetBattlePlayerObj(scoreKingID)
            scoreKingName = scoreKingObj.name
            
        drPlayerList = []
        for rank, battleObj in enumerate(factionObj.battlePlayerSortList, 1):
            playerID = battleObj.playerID
            score = battleObj.score
@@ -1734,6 +1743,10 @@
                          factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt]
            battlePlayerList.append(playerInfo)
            
            drPlayerList.append({"playerID":playerID, "accID":battleObj.accID, "fightPower":battleObj.fightPower,
                                 "score":score, "auraScore":auraScore, "wallCollCnt":wallCollCnt,
                                 "superItemAwardCnt":superItemAwardCnt, "superItemContribution":battleObj.superItemContribution})
            player = copyMapMgr.FindPlayerByID(playerID)
            if not player:
                continue
@@ -1743,6 +1756,11 @@
            overDict.update({FBCommon.Over_rank:rank, "score":score, "highScoreToday":highScoreToday, "onlineTimes":onlineTimes, "faction":faction})
            FBCommon.NotifyFBOver(player, ChConfig.Def_FBMapID_CrossBattlefield, lineID, isWinner, overDict)
            
        drFactionInfo = {"faction":faction, "score":factionObj.score, "hurtBossPlayerDict":factionObj.hurtBossPlayerDict,
                         "superItemProgress":factionObj.superItemProgress, "superItemPlayerID":factionObj.superItemPlayerID,
                         "drPlayerList":drPlayerList}
        drDict["faction_%s" % faction] = drFactionInfo
    GameWorld.Log("本场最终结算积分王: scoreKingID=%s" % scoreKingID, fbPropertyID)
            
    # 同步GameServer 比赛结果
@@ -1750,6 +1768,9 @@
    msgInfo = str([hmNum, fbPropertyID, zoneID, funcLineID, winnerFaction, superItemInfo, finalSuperItemPlayerID, finalSuperItemPlayerName, superItemPlayerIDList, scoreKingID, scoreKingName, battlePlayerList])
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "CrossBattlefieldOver", msgInfo, len(msgInfo))
    
    # 记录流向
    DataRecordPack.SendEventPack("CrossBattlefieldOver", drDict)
    FBCommon.SetFBStep(FB_Step_LeaveTime, tick)
    return