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 = ''
 | 
			
		||||
                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:
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
            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() + ' [' + c.id + '],'
 | 
			
		||||
                    msg += ' ' + c.get_char_name() + ' [' + str(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.")
 | 
			
		||||
            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)
 | 
			
		||||
            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 = True
 | 
			
		||||
                msg += ' ' + c.get_char_name() + ' [' + c.id + '],'
 | 
			
		||||
                    c.is_muted = False
 | 
			
		||||
                    msg += ' ' + c.get_char_name() + ' [' + str(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.")
 | 
			
		||||
            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:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user