mirror of
https://github.com/FAUSheppy/skillbird
synced 2025-12-10 16:28:32 +01:00
change misleading variable name
This commit is contained in:
@@ -128,19 +128,18 @@ def searchPlayerByName(name):
|
|||||||
# update ranks #
|
# update ranks #
|
||||||
updatePlayerRanks(force=True)
|
updatePlayerRanks(force=True)
|
||||||
|
|
||||||
# build rank tupel #
|
resultPlayers = []
|
||||||
playerRankTupel = []
|
|
||||||
for p in players:
|
for p in players:
|
||||||
try:
|
try:
|
||||||
playerRankTupel += [(p.steamid, p.name, p.rating, player_ranks[p])]
|
resultPlayers += [(p.steamid, p.name, p.rating, player_ranks[p])]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
noRankExplanation = "inactive"
|
noRankExplanation = "inactive"
|
||||||
if p.games < 10:
|
if p.games < 10:
|
||||||
noRankExplanation = "not enough games"
|
noRankExplanation = "not enough games"
|
||||||
playerRankTupel += [(p.steamid, p.name, p.rating, noRankExplanation)]
|
resultPlayers += [(p.steamid, p.name, p.rating, noRankExplanation)]
|
||||||
finally:
|
finally:
|
||||||
TS.unlock()
|
TS.unlock()
|
||||||
return playerRankTupel
|
return resultPlayers
|
||||||
|
|
||||||
def getPlayerRank(playerID):
|
def getPlayerRank(playerID):
|
||||||
'''Get a players rank'''
|
'''Get a players rank'''
|
||||||
@@ -172,13 +171,15 @@ def getBalancedTeams(players, buddies=None, teamCount=2):
|
|||||||
i += 1
|
i += 1
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def qualityForTeams(teamArray):
|
def qualityForTeams(teamArray, useNames=True):
|
||||||
'''Get quality for number of teams with players'''
|
'''Get quality for number of teams with players'''
|
||||||
|
|
||||||
if not teamArray or len(teamArray) < 2 or not teamArray[0]:
|
if not teamArray or len(teamArray) < 2 or not teamArray[0]:
|
||||||
raise ValueError("Team Array must be more than one team with more than one player each")
|
raise ValueError("Team Array must be more than one team with more than one player each")
|
||||||
|
|
||||||
if type(teamArray[0][0]) == str:
|
if useNames:
|
||||||
|
teamArray = [ [ searchPlayerByName(playerID)[0] for playerID in team ] for team in teamArray ]
|
||||||
|
elif type(teamArray[0][0]) == str:
|
||||||
teamArray = [ [ Player.DummyPlayer(playerID) for playerID in team ] for team in teamArray ]
|
teamArray = [ [ Player.DummyPlayer(playerID) for playerID in team ] for team in teamArray ]
|
||||||
|
|
||||||
for team in teamArray:
|
for team in teamArray:
|
||||||
|
|||||||
Reference in New Issue
Block a user