improve forfeitplayer

This commit is contained in:
Fabian Dill 2020-01-24 00:12:23 +01:00
parent d608689d73
commit 94759fd1c4
2 changed files with 5 additions and 5 deletions

View File

@ -323,11 +323,10 @@ async def console(ctx : Context):
slot = int(command[1])
forfeit_player(ctx, team, slot)
if command[0] == '/forfeitplayer' and len(command) > 1:
team = int(command[2]) - 1 if len(command) > 2 and command[2].isdigit() else None
for client in ctx.clients:
if client.auth and client.name.lower() == command[1].lower() and (team is None or team == client.team):
if client.socket and not client.socket.closed:
forfeit_player(ctx, client.team, client.slot)
seeked_player = command[1].lower()
for (team, slot), name in ctx.player_names.items():
if name.lower() == seeked_player:
forfeit_player(ctx, team, slot)
if command[0] == '/senditem' and len(command) > 2:
[(player, item)] = re.findall(r'\S* (\S*) (.*)', input)
if item in Items.item_table:

View File

@ -21,6 +21,7 @@ Basis is a .yaml file that sets these weights. You can find an easy.yaml in this
MultiServer.py
* Added a try/except to prevent malformed console commands from crashing the entire server
* /forfeitplayer Playername now works when the player is not currently connected
* Added /hint command on the server (use just /hint for help on command)
can be used as /hint Playername Itemname
All Itemnames can be found in Items.py starting at line 25