allow kicking of players with spaces in name (permanent solution later)
This commit is contained in:
parent
c4aaf24ab1
commit
ea53fff43e
|
@ -624,8 +624,9 @@ class ServerCommandProcessor(CommandProcessor):
|
||||||
def default(self, raw: str):
|
def default(self, raw: str):
|
||||||
notify_all(self.ctx, '[Server]: ' + raw)
|
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"""
|
"""Kick specified player from the server"""
|
||||||
|
player_name = " ".join(player_name)
|
||||||
for client in self.ctx.clients:
|
for client in self.ctx.clients:
|
||||||
if client.auth and client.name.lower() == player_name.lower() and client.socket and not client.socket.closed:
|
if client.auth and client.name.lower() == player_name.lower() and client.socket and not client.socket.closed:
|
||||||
asyncio.create_task(client.socket.close())
|
asyncio.create_task(client.socket.close())
|
||||||
|
|
Loading…
Reference in New Issue