| | |
| | | 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:
|
| | |
| | | continue
|
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | 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()):
|
| | |
| | | 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()):
|
| | |
| | | if not isAllLine and tagFBLineID != fblineID:
|
| | | continue
|
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | hpPer = GameLogic_HorsePetBoss.GetBossRemainHPPer(fblineID, tick)
|
| | | 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)
|
| | |
| | | if not isAllLine and tagFBLineID != fblineID:
|
| | | continue
|
| | | playerCnt = playerManager.GetPlayerCount()
|
| | | hpPer = GameLogic_AllFamilyBoss.GetBossRemainHPPer(tick)
|
| | | hpPer = GameLogic_AllFamilyBoss.GetBossRemainHPPer(index, tick)
|
| | | fbLinePlayerCntDict[fblineID] = [playerCnt, str(hpPer)]
|
| | | if not isAllLine:
|
| | | break
|
| | | |
| | | else:
|
| | | return
|
| | | return [tagMapID, fbLinePlayerCntDict]
|