| | |
| | | import PlayerActivity
|
| | | import GameWorldProcess
|
| | | import NPCCustomRefresh
|
| | | import DataRecordPack
|
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import SkillCommon
|
| | |
| | | class BattleWorld():
|
| | |
|
| | | def __init__(self):
|
| | | self.startTime = int(time.time())
|
| | | self.hmNum = 0
|
| | | self.callOpenPlayerInfo = {} # 本场次购买召集的玩家信息 {playerID:faction, ...}
|
| | | self.superItemInfo = [] # 大奖信息 [物品ID,个数,是否拍品]
|
| | |
| | | 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)
|
| | |
| | | scoreKingObj = GetBattlePlayerObj(scoreKingID)
|
| | | scoreKingName = scoreKingObj.name
|
| | |
|
| | | drPlayerList = []
|
| | | for rank, battleObj in enumerate(factionObj.battlePlayerSortList, 1):
|
| | | playerID = battleObj.playerID
|
| | | score = battleObj.score
|
| | |
| | | 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
|
| | |
| | | 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 比赛结果
|
| | |
| | | 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
|
| | |
|