aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-24 18:48:13 +0200
committerCerapter <cerap@protonmail.com>2018-08-24 18:48:13 +0200
commit6d278330a2299fb00937622ad40725f23898794c (patch)
treea16f9f168eb3106c972129b29d639b67219d9c60 /server
parent91ad46eea043673b188f5b5d4be49d66e0b7ba0d (diff)
`/getarea` now shows the CM, `/jukebox_toggle` and `/jukebox_skip` are now CM commands as well.
Diffstat (limited to 'server')
-rw-r--r--server/client_manager.py5
-rw-r--r--server/commands.py20
2 files changed, 19 insertions, 6 deletions
diff --git a/server/client_manager.py b/server/client_manager.py
index 709e0d8f..c5e0b10c 100644
--- a/server/client_manager.py
+++ b/server/client_manager.py
@@ -225,7 +225,10 @@ class ClientManager:
sorted_clients.append(client)
sorted_clients = sorted(sorted_clients, key=lambda x: x.get_char_name())
for c in sorted_clients:
- info += '\r\n[{}] {}'.format(c.id, c.get_char_name())
+ info += '\r\n'
+ if c.is_cm:
+ info +='[CM]'
+ info += '[{}] {}'.format(c.id, c.get_char_name())
if self.is_mod:
info += ' ({})'.format(c.ipid)
info += ': {}'.format(c.name)
diff --git a/server/commands.py b/server/commands.py
index 16a4a3b1..6d34338d 100644
--- a/server/commands.py
+++ b/server/commands.py
@@ -169,15 +169,20 @@ def ooc_cmd_currentmusic(client, arg):
client.area.current_music_player))
def ooc_cmd_jukebox_toggle(client, arg):
- if not client.is_mod:
+ if not client.is_mod and not client.is_cm:
raise ClientError('You must be authorized to do that.')
if len(arg) != 0:
raise ArgumentError('This command has no arguments.')
client.area.jukebox = not client.area.jukebox
- client.area.send_host_message('A mod has set the jukebox to {}.'.format(client.area.jukebox))
+ changer = 'Unknown'
+ if client.is_cm:
+ changer = 'The CM'
+ elif client.is_mod:
+ changer = 'A mod'
+ client.area.send_host_message('{} has set the jukebox to {}.'.format(changer, client.area.jukebox))
def ooc_cmd_jukebox_skip(client, arg):
- if not client.is_mod:
+ if not client.is_mod and not client.is_cm:
raise ClientError('You must be authorized to do that.')
if len(arg) != 0:
raise ArgumentError('This command has no arguments.')
@@ -186,10 +191,15 @@ def ooc_cmd_jukebox_skip(client, arg):
if len(client.area.jukebox_votes) == 0:
raise ClientError('There is no song playing right now, skipping is pointless.')
client.area.start_jukebox()
+ changer = 'Unknown'
+ if client.is_cm:
+ changer = 'The CM'
+ elif client.is_mod:
+ changer = 'A mod'
if len(client.area.jukebox_votes) == 1:
- client.area.send_host_message('A mod has forced a skip, restarting the only jukebox song.')
+ client.area.send_host_message('{} has forced a skip, restarting the only jukebox song.'.format(changer))
else:
- client.area.send_host_message('A mod has forced a skip to the next jukebox song.')
+ client.area.send_host_message('{} has forced a skip to the next jukebox song.'.format(changer))
logger.log_server('[{}][{}]Skipped the current jukebox song.'.format(client.area.id, client.get_char_name()))
def ooc_cmd_jukebox(client, arg):