def METHOD_NAME(connection, args, silent=False):
    position = None
    player = None
    arg_count = len(args)
    initial_index = 1 if arg_count == 2 or arg_count == 4 else 0
    # the target position is a <sector>
    if arg_count == 1 or arg_count == 2:
        x, y = coordinates(args[initial_index])
        x += 32
        y += 32
        z = connection.protocol.map.get_height(x, y) - 2
        position = args[initial_index].upper()
    # the target position is <x> <y> <z>
    elif arg_count == 3 or arg_count == 4:
        x = min(max(0, int(args[initial_index])), 511)
        y = min(max(0, int(args[initial_index + 1])), 511)
        z = min(max(0, int(args[initial_index + 2])),
                connection.protocol.map.get_height(x, y) - 2)
        position = '%d %d %d' % (x, y, z)
    else:
        raise ValueError('Wrong number of parameters!')
    # no player specified
    if arg_count == 1 or arg_count == 3:
        # must be run by a player in this case because moving self
        if connection not in connection.protocol.players.values():
            raise ValueError("Both player and target player are required")
        player = connection.name
    # player specified
    elif arg_count == 2 or arg_count == 4:
        if not (connection.admin or connection.rights.move_others):
            raise PermissionDenied(
                "moving other players requires the move_others right")
        player = args[0]
    player = get_player(connection.protocol, player)
    silent = connection.invisible or silent
    player.set_location((x, y, z))
    if connection is player:
        message = ('%s ' + ('silently ' if silent else '') + 'teleported to '
                   'location %s')
        message = message % (player.name, position)
    else:
        message = ('%s ' + ('silently ' if silent else '') + 'teleported %s '
                   'to location %s')
        message = message % (connection.name, player.name, position)
    if silent:
        connection.protocol.irc_say('* ' + message)
    else:
        connection.protocol.broadcast_chat(message, irc=True)