diff options
| author | Cerapter <cerap@protonmail.com> | 2018-08-29 16:13:11 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-08-29 16:13:11 +0200 |
| commit | 57fd4b9b9dcf81fb2d607ef11495acf11906fe01 (patch) | |
| tree | 6b3ff21d2d2b208f47a9df2dd391742c88d742d3 | |
| parent | 46e64d6077c6a9aa10f8331f43b7d8e34ba8d82f (diff) | |
Fixed jukebox not emptying on toggle, and mod actions on multiple IPIDs.
| -rw-r--r-- | server/area_manager.py | 4 | ||||
| -rw-r--r-- | server/commands.py | 64 |
2 files changed, 34 insertions, 34 deletions
diff --git a/server/area_manager.py b/server/area_manager.py index e1b7e552..ad36362d 100644 --- a/server/area_manager.py +++ b/server/area_manager.py @@ -168,8 +168,8 @@ class AreaManager: self.current_music = '' return - if vote_picked.char_id != self.jukebox_prev_char_id or vote_picked.name != self.current_music or len(self.jukebox_votes) > 1: - self.jukebox_prev_char_id = vote_picked.char_id + if vote_picked.client.char_id != self.jukebox_prev_char_id or vote_picked.name != self.current_music or len(self.jukebox_votes) > 1: + self.jukebox_prev_char_id = vote_picked.client.char_id if vote_picked.showname == '': self.send_command('MC', vote_picked.name, vote_picked.client.char_id) else: diff --git a/server/commands.py b/server/commands.py index 4c79c290..f951ca68 100644 --- a/server/commands.py +++ b/server/commands.py @@ -329,9 +329,9 @@ def ooc_cmd_kick(client, arg): if not client.is_mod: raise ClientError('You must be authorized to do that.') if len(arg) == 0: - raise ArgumentError('You must specify a target. Use /kick <ipid>.') + raise ArgumentError('You must specify a target. Use /kick <ipid> <ipid> ...') args = list(arg.split(' ')) - client.send_host_message('Attempting to ban {} IPIDs.'.format(len(args))) + client.send_host_message('Attempting to kick {} IPIDs.'.format(len(args))) for raw_ipid in args: try: ipid = int(raw_ipid) @@ -350,7 +350,7 @@ def ooc_cmd_ban(client, arg): if not client.is_mod: raise ClientError('You must be authorized to do that.') if len(arg) == 0: - raise ArgumentError('You must specify a target. Use /ban <ipid>.') + raise ArgumentError('You must specify a target. Use /ban <ipid> <ipid> ...') args = list(arg.split(' ')) client.send_host_message('Attempting to ban {} IPIDs.'.format(len(args))) for raw_ipid in args: @@ -375,7 +375,7 @@ def ooc_cmd_unban(client, arg): if not client.is_mod: raise ClientError('You must be authorized to do that.') if len(arg) == 0: - raise ArgumentError('You must specify a target. Use /unban <ipid>.') + raise ArgumentError('You must specify a target. Use /unban <ipid> <ipid> ...') args = list(arg.split(' ')) client.send_host_message('Attempting to unban {} IPIDs.'.format(len(args))) for raw_ipid in args: @@ -403,21 +403,21 @@ def ooc_cmd_mute(client, arg): args = list(arg.split(' ')) client.send_host_message('Attempting to mute {} IPIDs.'.format(len(args))) for raw_ipid in args: - try: + if raw_ipid.isdigit(): ipid = int(raw_ipid) - except: - raise ClientError('{} does not look like a valid IPID.'.format(raw_ipid)) - try: - clients = client.server.client_manager.get_targets(client, TargetType.IPID, int(ipid), False) - msg = 'Muted ' + str(ipid) + ' clients' - for c in clients: - c.is_muted = True - msg += ' ' + c.get_char_name() + ' [' + c.id + '],' - msg = msg[:-1] - msg += '.' - client.send_host_message('{}'.format(msg)) - except: - client.send_host_message("No targets found. Use /mute <ipid> for mute.") + clients = client.server.client_manager.get_targets(client, TargetType.IPID, ipid, False) + if (clients): + msg = 'Muted ' + str(ipid) + ' clients' + for c in clients: + c.is_muted = True + msg += ' ' + c.get_char_name() + ' [' + str(c.id) + '],' + msg = msg[:-1] + msg += '.' + client.send_host_message('{}'.format(msg)) + else: + client.send_host_message("No targets found. Use /mute <ipid> <ipid> ... for mute.") + else: + client.send_host_message('{} does not look like a valid IPID.'.format(raw_ipid)) def ooc_cmd_unmute(client, arg): if not client.is_mod: @@ -427,21 +427,21 @@ def ooc_cmd_unmute(client, arg): args = list(arg.split(' ')) client.send_host_message('Attempting to unmute {} IPIDs.'.format(len(args))) for raw_ipid in args: - try: + if raw_ipid.isdigit(): ipid = int(raw_ipid) - except: - raise ClientError('{} does not look like a valid IPID.'.format(raw_ipid)) - try: - clients = client.server.client_manager.get_targets(client, TargetType.IPID, int(ipid), False) - msg = 'Unmuted ' + str(ipid) + ' clients' - for c in clients: - c.is_muted = True - msg += ' ' + c.get_char_name() + ' [' + c.id + '],' - msg = msg[:-1] - msg += '.' - client.send_host_message('{}'.format(msg)) - except: - client.send_host_message("No targets found. Use /unmute <ipid> for unmute.") + clients = client.server.client_manager.get_targets(client, TargetType.IPID, ipid, False) + if (clients): + msg = 'Unmuted ' + str(ipid) + ' clients' + for c in clients: + c.is_muted = False + msg += ' ' + c.get_char_name() + ' [' + str(c.id) + '],' + msg = msg[:-1] + msg += '.' + client.send_host_message('{}'.format(msg)) + else: + client.send_host_message("No targets found. Use /unmute <ipid> <ipid> ... for unmute.") + else: + client.send_host_message('{} does not look like a valid IPID.'.format(raw_ipid)) def ooc_cmd_login(client, arg): if len(arg) == 0: |
