Skip to content

Commit

Permalink
Change msg. and utilize PermissionDenied in /kill
Browse files Browse the repository at this point in the history
  • Loading branch information
godwhoa committed Feb 27, 2018
1 parent cc1076a commit 66d262a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion piqueserver/commands.py
Expand Up @@ -384,7 +384,7 @@ def handle_command(connection, command, parameters):
except CommandError as e:
msg = str(e)
except PermissionDenied:
msg = "Permission denied"
msg = 'You can\'t use this command'
except ValueError:
msg = 'Invalid parameters'

Expand Down
4 changes: 2 additions & 2 deletions piqueserver/core_commands/player.py
@@ -1,4 +1,4 @@
from piqueserver.commands import command, get_player
from piqueserver.commands import command, get_player, PermissionDenied

@command("client", "cli")
def client(connection, target=None):
Expand Down Expand Up @@ -57,7 +57,7 @@ def kill(connection, value=None):
player = connection
else:
if not connection.rights.kill and not connection.admin:
return "You can't use this command"
raise PermissionDenied()
player = get_player(connection.protocol, value, False)
player.kill()
if connection is not player:
Expand Down

0 comments on commit 66d262a

Please sign in to comment.