From 8599c76647791ed9477c13b01a3d21a2c3c208dd Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 18 Apr 2020 21:46:57 +0200 Subject: [PATCH] Disallow spaces in generated names --- Main.py | 2 +- MultiServer.py | 3 +-- Plando.py | 2 +- Utils.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Main.py b/Main.py index ec8722d4..caf43a2d 100644 --- a/Main.py +++ b/Main.py @@ -204,7 +204,7 @@ def main(args, seed=None): outfilepname += f'_P{player}' if world.players > 1 or world.teams > 1: outfilepname += f"_{world.player_names[player][team].replace(' ', '_')}" if world.player_names[player][ - team] != 'Player %d' % player else '' + team] != 'Player%d' % player else '' outfilesuffix = ('_%s_%s-%s-%s-%s%s_%s-%s%s%s%s%s' % (world.logic[player], world.difficulty[player], world.difficulty_adjustments[player], world.mode[player], world.goal[player], diff --git a/MultiServer.py b/MultiServer.py index 644ec719..ad2dbbb9 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -624,9 +624,8 @@ class ServerCommandProcessor(CommandProcessor): def default(self, raw: str): notify_all(self.ctx, '[Server]: ' + raw) - def _cmd_kick(self, *player_name: str): + def _cmd_kick(self, player_name: str): """Kick specified player from the server""" - player_name = " ".join(player_name) for client in self.ctx.clients: if client.auth and client.name.lower() == player_name.lower() and client.socket and not client.socket.closed: asyncio.create_task(client.socket.close()) diff --git a/Plando.py b/Plando.py index d864e8d4..1e038939 100755 --- a/Plando.py +++ b/Plando.py @@ -24,7 +24,7 @@ def main(args): # initialize the world world = World(1, 'vanilla', 'noglitches', 'standard', 'normal', 'none', 'on', 'ganon', 'freshness', False, False, False, False, False, False, None, False) - world.player_names[1].append("Player 1") + world.player_names[1].append("Player1") logger = logging.getLogger('') hasher = hashlib.md5() diff --git a/Utils.py b/Utils.py index 068d4078..4a3c173a 100644 --- a/Utils.py +++ b/Utils.py @@ -35,7 +35,7 @@ def parse_player_names(names, players, teams): team = [n[:16] for n in names[:players]] # where does the 16 character limit come from? while len(team) != players: - team.append(f"Player {len(team) + 1}") + team.append(f"Player{len(team) + 1}") ret.append(team) names = names[players:]