improve some random things

This commit is contained in:
Fabian Dill 2020-03-05 02:31:26 +01:00
parent 65ce80bf68
commit 9b82f220bb
3 changed files with 11 additions and 9 deletions

View File

@ -192,17 +192,17 @@ async def countdown(ctx: Context, timer):
def get_connected_players_string(ctx: Context):
auth_clients = [c for c in ctx.clients if c.auth]
if not auth_clients:
return 'No player connected'
return f'No player connected, of {len(ctx.player_names)} expected players'
auth_clients.sort(key=lambda c: (c.team, c.slot))
current_team = 0
text = 'Team #1: '
current_team = -1
text = ''
for c in auth_clients:
if c.team != current_team:
text += f':: Team #{c.team + 1}: '
current_team = c.team
text += f'{c.name} '
return 'Connected players: ' + text[:-1]
return f'Connected players ({len(auth_clients)} of {len(ctx.player_names)}) ' + text[:-1]
def get_received_items(ctx: Context, team: int, player: int):

View File

@ -70,12 +70,13 @@ def main():
for player in range(1, args.multi + 1):
path = getattr(args, f'p{player}')
if path:
if path not in weights_cache:
try:
try:
if path not in weights_cache:
weights_cache[path] = get_weights(path)
except Exception as e:
raise ValueError(f"File {path} is destroyed. Please fix your yaml.") from e
print(f"P{player} Weights: {path} >> {weights_cache[path]['description']}")
print(f"P{player} Weights: {path} >> {weights_cache[path]['description']}")
except Exception as e:
raise ValueError(f"File {path} is destroyed. Please fix your yaml.") from e
erargs = parse_arguments(['--multi', str(args.multi)])
erargs.seed = seed
erargs.name = {x: "" for x in range(1, args.multi + 1)} # only so it can be overwrittin in mystery

View File

@ -107,6 +107,7 @@ Triforce_texts = [
"You get one\nwish. Choose\nwisely, hero!",
"Can you please\nbreak us three\nup? Thanks.",
" Pick us up\n before we\n get dizzy!",
"\n Honk."
]
BombShop2_texts = ['Bombs!\nBombs!\nBiggest!\nBestest!\nGreatest!\nBoomest!']
Sahasrahla2_texts = ['You already got my item, idiot.', 'Why are you still talking to me?', 'This text won\'t change.', 'Have you met my brother, Hasarahshla?']