From a9e5ae2ed13bffe82038291776ffa68f65becce6 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期一, 10 六月 2019 10:57:18 +0800 Subject: [PATCH] 7145 【2.0】【后端】仙盟新增兑换活跃令功能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py | 78 +++++++++++++++++++++++++++++++++++--- 1 files changed, 71 insertions(+), 7 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py index 4a04544..e38ff46 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FBLinePlayerCnt.py @@ -19,7 +19,9 @@ #导入 -import NPCCommon +import GameLogic_ZhuXianBoss +import GameLogic_HorsePetBoss +import GameLogic_AllFamilyBoss import GameWorld import IPY_GameWorld import ChConfig @@ -41,17 +43,17 @@ GameWorld.DebugLog("GY_Query_FBLinePlayerCnt DoLogic() query_Type=%s,query_ID=%s,packCMDList=%s,tick=%s" % \ (query_Type, query_ID, packCMDList, tick)) - if not packCMDList or len(packCMDList) < 3: + if not packCMDList or len(packCMDList) < 2: GameWorld.DebugLog(" DoLogic() return []") return [] - tagMapID = packCMDList[0] # 目标地图id - tagFBLineID = packCMDList[1] # 线路id - isAllLine = packCMDList[2] # 查询的NPCID列表 + tagMapID, queryFBLineIDList = packCMDList + tagFBLineID = 0 if not queryFBLineIDList else queryFBLineIDList[0] # 线路id + isAllLine = not queryFBLineIDList # 查询的NPCID列表 gameWorldManager = GameWorld.GetGameWorld() fbLinePlayerCntDict = {} if tagMapID == ChConfig.Def_FBMapID_SealDemon: - for index in range(gameWorldManager.GetGameWorldCount()): + for index in xrange(gameWorldManager.GetGameWorldCount()): gameWorld = IPY_GameWorld.IPY_GameWorld(index) playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index) fblineID = gameWorld.GetPropertyID() - 1 @@ -60,7 +62,69 @@ if not isAllLine and tagFBLineID != fblineID: continue playerCnt = playerManager.GetPlayerCount() - fbLinePlayerCntDict[fblineID] = playerCnt + fbLinePlayerCntDict[fblineID] = [playerCnt] + if not isAllLine: + break + + elif tagMapID == ChConfig.Def_FBMapID_DemonKing: + for index in xrange(gameWorldManager.GetGameWorldCount()): + gameWorld = IPY_GameWorld.IPY_GameWorld(index) + playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index) + fblineID = gameWorld.GetPropertyID() - 1 + if fblineID < 0: + continue + if queryFBLineIDList and fblineID not in queryFBLineIDList: + continue + playerCnt = playerManager.GetPlayerCount() + fbLinePlayerCntDict[fblineID] = [playerCnt] + if len(queryFBLineIDList) == len(fbLinePlayerCntDict): + break + + elif tagMapID == ChConfig.Def_FBMapID_ZhuXianBoss: + for index in xrange(gameWorldManager.GetGameWorldCount()): + gameWorld = IPY_GameWorld.IPY_GameWorld(index) + playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index) + fblineID = gameWorld.GetPropertyID() - 1 + if fblineID < 0: + continue + if not isAllLine and tagFBLineID != fblineID: + continue + playerCnt = playerManager.GetPlayerCount() + ownerName = GameLogic_ZhuXianBoss.GetFirstOwnerName(fblineID) + fbLinePlayerCntDict[fblineID] = [playerCnt, ownerName] + if not isAllLine: + break + + elif tagMapID == ChConfig.Def_FBMapID_HorsePetBoss: + for index in xrange(gameWorldManager.GetGameWorldCount()): + gameWorld = IPY_GameWorld.IPY_GameWorld(index) + playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index) + fblineID = gameWorld.GetPropertyID() - 1 + if fblineID < 0: + continue + if not isAllLine and tagFBLineID != fblineID: + continue + playerCnt = playerManager.GetPlayerCount() + hpPer = GameLogic_HorsePetBoss.GetBossRemainHPPer(index, fblineID, tick) + fbLinePlayerCntDict[fblineID] = [playerCnt, str(hpPer)] + if not isAllLine: + break + + elif tagMapID == ChConfig.Def_FBMapID_AllFamilyBoss: + for index in xrange(gameWorldManager.GetGameWorldCount()): + gameWorld = IPY_GameWorld.IPY_GameWorld(index) + playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index) + fblineID = gameWorld.GetPropertyID() - 1 + if fblineID < 0: + continue + if not isAllLine and tagFBLineID != fblineID: + continue + playerCnt = playerManager.GetPlayerCount() + hpPer = GameLogic_AllFamilyBoss.GetBossRemainHPPer(index, tick) + fbLinePlayerCntDict[fblineID] = [playerCnt, str(hpPer)] + if not isAllLine: + break + else: return return [tagMapID, fbLinePlayerCntDict] -- Gitblit v1.8.0