Fixed jukebox not emptying on toggle, and mod actions on multiple IPIDs.
This commit is contained in:
parent
46e64d6077
commit
57fd4b9b9d
@ -168,8 +168,8 @@ class AreaManager:
|
|||||||
self.current_music = ''
|
self.current_music = ''
|
||||||
return
|
return
|
||||||
|
|
||||||
if vote_picked.char_id != self.jukebox_prev_char_id or vote_picked.name != self.current_music or len(self.jukebox_votes) > 1:
|
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.char_id
|
self.jukebox_prev_char_id = vote_picked.client.char_id
|
||||||
if vote_picked.showname == '':
|
if vote_picked.showname == '':
|
||||||
self.send_command('MC', vote_picked.name, vote_picked.client.char_id)
|
self.send_command('MC', vote_picked.name, vote_picked.client.char_id)
|
||||||
else:
|
else:
|
||||||
|
@ -329,9 +329,9 @@ def ooc_cmd_kick(client, arg):
|
|||||||
if not client.is_mod:
|
if not client.is_mod:
|
||||||
raise ClientError('You must be authorized to do that.')
|
raise ClientError('You must be authorized to do that.')
|
||||||
if len(arg) == 0:
|
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(' '))
|
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:
|
for raw_ipid in args:
|
||||||
try:
|
try:
|
||||||
ipid = int(raw_ipid)
|
ipid = int(raw_ipid)
|
||||||
@ -350,7 +350,7 @@ def ooc_cmd_ban(client, arg):
|
|||||||
if not client.is_mod:
|
if not client.is_mod:
|
||||||
raise ClientError('You must be authorized to do that.')
|
raise ClientError('You must be authorized to do that.')
|
||||||
if len(arg) == 0:
|
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(' '))
|
args = list(arg.split(' '))
|
||||||
client.send_host_message('Attempting to ban {} IPIDs.'.format(len(args)))
|
client.send_host_message('Attempting to ban {} IPIDs.'.format(len(args)))
|
||||||
for raw_ipid in args:
|
for raw_ipid in args:
|
||||||
@ -375,7 +375,7 @@ def ooc_cmd_unban(client, arg):
|
|||||||
if not client.is_mod:
|
if not client.is_mod:
|
||||||
raise ClientError('You must be authorized to do that.')
|
raise ClientError('You must be authorized to do that.')
|
||||||
if len(arg) == 0:
|
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(' '))
|
args = list(arg.split(' '))
|
||||||
client.send_host_message('Attempting to unban {} IPIDs.'.format(len(args)))
|
client.send_host_message('Attempting to unban {} IPIDs.'.format(len(args)))
|
||||||
for raw_ipid in args:
|
for raw_ipid in args:
|
||||||
@ -403,21 +403,21 @@ def ooc_cmd_mute(client, arg):
|
|||||||
args = list(arg.split(' '))
|
args = list(arg.split(' '))
|
||||||
client.send_host_message('Attempting to mute {} IPIDs.'.format(len(args)))
|
client.send_host_message('Attempting to mute {} IPIDs.'.format(len(args)))
|
||||||
for raw_ipid in args:
|
for raw_ipid in args:
|
||||||
try:
|
if raw_ipid.isdigit():
|
||||||
ipid = int(raw_ipid)
|
ipid = int(raw_ipid)
|
||||||
except:
|
clients = client.server.client_manager.get_targets(client, TargetType.IPID, ipid, False)
|
||||||
raise ClientError('{} does not look like a valid IPID.'.format(raw_ipid))
|
if (clients):
|
||||||
try:
|
msg = 'Muted ' + str(ipid) + ' clients'
|
||||||
clients = client.server.client_manager.get_targets(client, TargetType.IPID, int(ipid), False)
|
for c in clients:
|
||||||
msg = 'Muted ' + str(ipid) + ' clients'
|
c.is_muted = True
|
||||||
for c in clients:
|
msg += ' ' + c.get_char_name() + ' [' + str(c.id) + '],'
|
||||||
c.is_muted = True
|
msg = msg[:-1]
|
||||||
msg += ' ' + c.get_char_name() + ' [' + c.id + '],'
|
msg += '.'
|
||||||
msg = msg[:-1]
|
client.send_host_message('{}'.format(msg))
|
||||||
msg += '.'
|
else:
|
||||||
client.send_host_message('{}'.format(msg))
|
client.send_host_message("No targets found. Use /mute <ipid> <ipid> ... for mute.")
|
||||||
except:
|
else:
|
||||||
client.send_host_message("No targets found. Use /mute <ipid> for mute.")
|
client.send_host_message('{} does not look like a valid IPID.'.format(raw_ipid))
|
||||||
|
|
||||||
def ooc_cmd_unmute(client, arg):
|
def ooc_cmd_unmute(client, arg):
|
||||||
if not client.is_mod:
|
if not client.is_mod:
|
||||||
@ -427,21 +427,21 @@ def ooc_cmd_unmute(client, arg):
|
|||||||
args = list(arg.split(' '))
|
args = list(arg.split(' '))
|
||||||
client.send_host_message('Attempting to unmute {} IPIDs.'.format(len(args)))
|
client.send_host_message('Attempting to unmute {} IPIDs.'.format(len(args)))
|
||||||
for raw_ipid in args:
|
for raw_ipid in args:
|
||||||
try:
|
if raw_ipid.isdigit():
|
||||||
ipid = int(raw_ipid)
|
ipid = int(raw_ipid)
|
||||||
except:
|
clients = client.server.client_manager.get_targets(client, TargetType.IPID, ipid, False)
|
||||||
raise ClientError('{} does not look like a valid IPID.'.format(raw_ipid))
|
if (clients):
|
||||||
try:
|
msg = 'Unmuted ' + str(ipid) + ' clients'
|
||||||
clients = client.server.client_manager.get_targets(client, TargetType.IPID, int(ipid), False)
|
for c in clients:
|
||||||
msg = 'Unmuted ' + str(ipid) + ' clients'
|
c.is_muted = False
|
||||||
for c in clients:
|
msg += ' ' + c.get_char_name() + ' [' + str(c.id) + '],'
|
||||||
c.is_muted = True
|
msg = msg[:-1]
|
||||||
msg += ' ' + c.get_char_name() + ' [' + c.id + '],'
|
msg += '.'
|
||||||
msg = msg[:-1]
|
client.send_host_message('{}'.format(msg))
|
||||||
msg += '.'
|
else:
|
||||||
client.send_host_message('{}'.format(msg))
|
client.send_host_message("No targets found. Use /unmute <ipid> <ipid> ... for unmute.")
|
||||||
except:
|
else:
|
||||||
client.send_host_message("No targets found. Use /unmute <ipid> for unmute.")
|
client.send_host_message('{} does not look like a valid IPID.'.format(raw_ipid))
|
||||||
|
|
||||||
def ooc_cmd_login(client, arg):
|
def ooc_cmd_login(client, arg):
|
||||||
if len(arg) == 0:
|
if len(arg) == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user