player names should not contain spaces, but in case they do, this makes single-spaces work

This commit is contained in:
Fabian Dill 2020-04-19 00:14:43 +02:00
parent 8599c76647
commit 4f52a8db4c
1 changed files with 2 additions and 1 deletions

View File

@ -624,8 +624,9 @@ 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())