| | |
| | | resultLineID = -1 # 结果lineID
|
| | |
|
| | | gameWorldManager = GameWorld.GetGameWorld()
|
| | | maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
|
| | | maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID, tagMapLineID)
|
| | |
|
| | | GameWorld.Log(" DoLogic() tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
|
| | | for index in range(gameWorldManager.GetGameWorldCount()):
|
| | | GameWorld.Log(" DoLogic() tagMapID=%s,tagMapLineID=%s,maxPlayerCount=%s" % (tagMapID, tagMapLineID,maxPlayerCount))
|
| | | firstEmptyGameWorld = None
|
| | | sameLineGameWorldList = []
|
| | | for index in xrange(gameWorldManager.GetGameWorldCount()):
|
| | | gameWorld = IPY_GameWorld.IPY_GameWorld(index)
|
| | | playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
|
| | | propertyID = gameWorld.GetPropertyID()
|
| | | GameWorld.Log(" DoLogic() check gameworld index=%s,propertyID=%s,playerCount=%s" \
|
| | | % (index, propertyID, playerManager.GetPlayerCount()))
|
| | | curPlayerCnt = playerManager.GetPlayerCount()
|
| | | # GameWorld.Log(" DoLogic() check gameworld index=%s,propertyID=%s,playerCount=%s" \
|
| | | # % (index, propertyID, curPlayerCnt))
|
| | | if propertyID == 0 and not firstEmptyGameWorld:
|
| | | firstEmptyGameWorld = gameWorld
|
| | | # 如果不是同一线路属性的,则跳过
|
| | | # 如果当前人数超过额定人数,则跳过
|
| | | if propertyID == 0 or (propertyID == tagMapPropertyID \
|
| | | and playerManager.GetPlayerCount() < maxPlayerCount):
|
| | | gameWorld.SetPropertyID(tagMapPropertyID)
|
| | | if propertyID == 0:
|
| | | gameWorld.SetFBFirstOpen(1) # 开启副本
|
| | | resultLineID = gameWorld.GetLineID()
|
| | | GameWorld.Log(" DoLogic() check ok!resultLineID=%s" % (resultLineID))
|
| | | break
|
| | | if propertyID == tagMapPropertyID and curPlayerCnt < maxPlayerCount:
|
| | | sameLineGameWorldList.append([gameWorld, curPlayerCnt])
|
| | | findGameWorld = None
|
| | | if sameLineGameWorldList:
|
| | | sameLineGameWorldList.sort(key=lambda asd:asd[1])
|
| | | findGameWorld = sameLineGameWorldList[0][0]
|
| | | elif firstEmptyGameWorld:
|
| | | findGameWorld = firstEmptyGameWorld
|
| | | if findGameWorld:
|
| | | if findGameWorld.GetPropertyID() == 0:
|
| | | findGameWorld.SetFBFirstOpen(1) # 开启副本
|
| | | findGameWorld.SetPropertyID(tagMapPropertyID)
|
| | | resultLineID = findGameWorld.GetLineID()
|
| | | GameWorld.Log(" DoLogic() check ok!resultLineID=%s" % (resultLineID))
|
| | | |
| | |
|
| | | #===================================================================================================
|
| | | # # 战盟家园
|
| | |
| | | resultLineID = -1 # 结果lineID
|
| | |
|
| | | gameWorldManager = GameWorld.GetGameWorld()
|
| | | maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
|
| | | |
| | | GameWorld.Log(" DoLogic() tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
|
| | | GameWorld.Log(" DoLogic() tagMapID=%s,tagMapLineID=%s" % (tagMapID, tagMapLineID))
|
| | | findGameWord = None
|
| | | for index in range(gameWorldManager.GetGameWorldCount()):
|
| | | gameWorld = IPY_GameWorld.IPY_GameWorld(index)
|