MultiServer: remove accidental loop from !status

This commit is contained in:
Fabian Dill 2021-11-04 09:01:14 +01:00
parent 45f92536a6
commit bcfa5d0a7e
1 changed files with 7 additions and 8 deletions

View File

@ -567,15 +567,14 @@ def get_players_string(ctx: Context):
return f'{len(auth_clients)} players of {len(ctx.player_names)} connected ' + text[:-1] return f'{len(auth_clients)} players of {len(ctx.player_names)} connected ' + text[:-1]
def get_status_string(ctx: Context, team): def get_status_string(ctx: Context, team: int):
text = "Player Status on your team:" text = "Player Status on your team:"
for team in ctx.clients: for slot in ctx.locations:
for slot in ctx.locations: connected = len(ctx.clients[team][slot])
connected = len(ctx.clients[team][slot]) completion_text = f"({len(ctx.location_checks[team, slot])}/{len(ctx.locations[slot])})"
completion_text = f"({len(ctx.location_checks[team, slot])}/{len(ctx.locations[slot])})" goal_text = " and has finished." if ctx.client_game_state[team, slot] == ClientStatus.CLIENT_GOAL else "."
goal_text = " and has finished." if ctx.client_game_state[team, slot] == ClientStatus.CLIENT_GOAL else "." text += f"\n{ctx.get_aliased_name(team, slot)} has {connected} connection{'' if connected == 1 else 's'}" \
text += f"\n{ctx.get_aliased_name(team, slot)} has {connected} connection{'' if connected == 1 else 's'}" \ f"{goal_text} {completion_text}"
f"{goal_text} {completion_text}"
return text return text