function umc_check_lot_exists($world_id, $lot)
{
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    if (!is_numeric($world_id)) {
        $world_id = umc_get_worldguard_id('world', $world_id);
    }
    //  Make sure the region exists
    $sql = "SELECT id FROM minecraft_worldguard.region WHERE world_id = {$world_id} AND id = '{$lot}'";
    //echo $sql;
    $C = umc_mysql_fetch_all($sql);
    if (count($C) < 1) {
        // echo("No such region '$lot' found in world '$world_id'");
        return false;
    }
    return true;
}
Beispiel #2
0
function umc_create_cuboids()
{
    //echo "Starting Map generation<br>";
    // are we enlarging an existing map?
    $enlarge = true;
    $maxval = 2176 + 4 * 272;
    // define future map size here
    $enlarge_by = 4;
    $blocksize = 272;
    $worldname = "draftlands";
    $lot_prefix = 'draft';
    $version = '0';
    // lot version
    // editing stop
    $divider = $maxval / $blocksize * 2;
    $startchar = 64;
    $startcol = 1;
    $new_regions = array();
    $old_regions = array();
    $world_id = umc_get_worldguard_id('world', strtolower($worldname));
    if ($enlarge) {
        // get existing lots, users, flags
        $region_sql = "SELECT * FROM minecraft_worldguard.region\r\n                LEFT JOIN minecraft_worldguard.region_cuboid ON id=region_id\r\n                WHERE id LIKE '{$lot_prefix}%';";
        $D = umc_mysql_fetch_all($region_sql);
        foreach ($D as $region_row) {
            $lot = $region_row['id'];
            $old_regions[$lot]['coords'] = array('min_x' => $region_row['min_x'], 'min_y' => $region_row['min_y'], 'min_z' => $region_row['min_z'], 'max_x' => $region_row['max_x'], 'max_y' => $region_row['max_y'], 'max_z' => $region_row['max_z']);
            $old_regions[$lot]['users'] = array();
            $user_sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id LIKE '{$lot}';";
            $D_user = umc_mysql_fetch_all($user_sql);
            foreach ($D_user as $user_row) {
                $user_id = $user_row['user_id'];
                $old_regions[$lot]['users'][$user_id] = $user_row['owner'];
            }
            $old_regions[$lot]['flags'] = array();
            $flags_sql = "SELECT * FROM minecraft_worldguard.region_flag WHERE region_id LIKE '{$lot}';";
            $D_flags = umc_mysql_fetch_all($flags_sql);
            if (count($D_flags) > 0) {
                foreach ($D_flags as $flags_row) {
                    $flag = $flags_row['flag'];
                    $old_regions[$lot]['flags'][$flag] = $flags_row['value'];
                }
            }
        }
    }
    // start at 0 - 0 on the top left corner
    for ($z = 1; $z <= $divider; $z++) {
        // go from left to right, 30 fields
        if ($z >= 27) {
            $char = 'A' . chr($startchar + ($z - 26));
        } else {
            $char = chr($startchar + $z);
        }
        //echo "iteration z = $z<br>";
        for ($x = 0; $x < $divider; $x++) {
            // go from up to down
            $left_b = $maxval - $z * $blocksize;
            $up_b = -1 * $maxval + $x * $blocksize;
            $num = $startcol + $x;
            $up_b2 = $up_b + $blocksize - 1;
            $left_b2 = $left_b + $blocksize - 1;
            $new_lot = strtolower($lot_prefix . '_' . $char . $num);
            $flags = array();
            $users = array();
            $flags_a = array();
            $flags_b = array();
            $flags_c = array();
            $users_a = array();
            $users_b = array();
            $users_c = array();
            $reset = "'reset'";
            if ($enlarge) {
                // get old lot name
                if ($z >= 27) {
                    $old_char = 'A' . chr($startchar + ($z - 26 - $enlarge_by));
                } else {
                    $old_char = chr($startchar + $z - $enlarge_by);
                }
                $old_num = $num - $enlarge_by;
                // numbers start at 0
                $old_lot = strtolower($lot_prefix . '_' . $old_char . $old_num);
                if (isset($old_regions[$old_lot])) {
                    $flags = $old_regions[$old_lot]['flags'];
                    $users = $old_regions[$old_lot]['users'];
                    $reset = 'NULL';
                    if ($worldname == 'kingdom' || $worldname == 'draftlands') {
                        $flags_a = $old_regions[$old_lot . "_a"]['flags'];
                        $flags_b = $old_regions[$old_lot . "_b"]['flags'];
                        $flags_c = $old_regions[$old_lot . "_c"]['flags'];
                        $users_a = $old_regions[$old_lot . "_a"]['users'];
                        $users_b = $old_regions[$old_lot . "_b"]['users'];
                        $users_c = $old_regions[$old_lot . "_c"]['users'];
                    }
                }
            }
            if ($worldname !== 'kingdom' && $worldname !== 'draftlands') {
                $new_regions[$new_lot] = array('coords' => array('min_x' => $up_b, 'min_y' => 0, 'min_z' => $left_b, 'max_x' => $up_b2, 'max_y' => 256, 'max_z' => $left_b2), 'flags' => $flags, 'users' => $users, 'reset' => $reset);
            } else {
                $new_regions[$new_lot] = array('coords' => array('min_x' => $up_b, 'min_y' => 0, 'min_z' => $left_b, 'max_x' => $up_b2 - 16, 'max_y' => 256, 'max_z' => $left_b2 - 16), 'flags' => $flags, 'users' => $users, 'reset' => $reset);
                $new_regions[$new_lot . "_a"] = array('coords' => array('min_x' => $up_b2 - 15, 'min_y' => 0, 'min_z' => $left_b, 'max_x' => $up_b2, 'max_y' => 256, 'max_z' => $left_b2 - 16), 'flags' => $flags_a, 'users' => $users_a, 'reset' => $reset);
                $new_regions[$new_lot . "_b"] = array('coords' => array('min_x' => $up_b2 - 15, 'min_y' => 0, 'min_z' => $left_b2 - 15, 'max_x' => $up_b2, 'max_y' => 256, 'max_z' => $left_b2), 'flags' => $flags_b, 'users' => $users_b, 'reset' => $reset);
                $new_regions[$new_lot . "_c"] = array('coords' => array('min_x' => $up_b, 'min_y' => 0, 'min_z' => $left_b2 - 15, 'max_x' => $up_b2 - 16, 'max_y' => 256, 'max_z' => $left_b2), 'flags' => $flags_c, 'users' => $users_c, 'reset' => $reset);
            }
        }
    }
    $region_sql = 'INSERT INTO minecraft_worldguard.`region` (`id`, `world_id`, `type`, `priority`, `parent`) VALUES ';
    $cuboid_sql = 'INSERT INTO minecraft_worldguard.`region_cuboid` (`region_id`, `world_id`, `min_x`, `min_y`, `min_z`, `max_x`, `max_y`, `max_z`) VALUES ';
    $player_sql = 'INSERT INTO minecraft_worldguard.`region_players` (`region_id`, `world_id`, `user_id`, `owner`) VALUES ';
    $flags_sql = 'INSERT INTO minecraft_worldguard.`region_flag` (`world_id`, `region_id`, `flag`, `value`) VALUES ';
    $version_sql = 'INSERT INTO minecraft_srvr.`lot_version`(`lot`, `version`, `choice`, `timestamp`, `mint_version`) VALUES ';
    foreach ($new_regions as $lot => $data) {
        $region_sql .= "\n('{$lot}',{$world_id},'cuboid',0,NULL), ";
        $coords = $data['coords'];
        $cuboid_sql .= "\n('{$lot}',{$world_id},{$coords['min_x']},{$coords['min_y']},{$coords['min_z']},{$coords['max_x']},{$coords['max_y']},{$coords['max_z']}), ";
        $version_sql .= "\n('{$lot}','{$version}',{$data['reset']},NOW(),'{$version}'), ";
        foreach ($data['users'] as $user_id => $owner) {
            $player_sql .= "\n('{$lot}',{$world_id},{$user_id},{$owner}), ";
        }
        foreach ($data['flags'] as $flag => $value) {
            $flags_sql .= "\n({$world_id},'{$lot}','{$flag}','{$value}'), ";
        }
    }
    echo "DELETE FROM  minecraft_worldguard.region WHERE id LIKE '{$lot_prefix}_%';\n";
    echo "DELETE FROM  minecraft_srvr.lot_version WHERE lot LIKE '{$lot_prefix}_%';\n";
    echo rtrim($region_sql, ", ") . ";\n";
    echo rtrim($cuboid_sql, ", ") . ";\n";
    echo rtrim($player_sql, ", ") . ";\n";
    echo rtrim($flags_sql, ", ") . ";\n";
    echo rtrim($version_sql, ", ") . ";\n";
}
function umc_contests_join()
{
    global $UMC_USER;
    $args = $UMC_USER['args'];
    $player = $UMC_USER['username'];
    $debug = true;
    if (!isset($args[2])) {
        umc_show_help($args);
        die;
    }
    $id = $args[2];
    umc_pretty_bar("darkblue", "-", "{darkcyan} Joining contest {$id} ");
    if (!is_numeric($id)) {
        umc_error("You have to enter a numeric contest ID ({$id}). See /contest list");
    }
    // find out if the contest is creative or survival
    $sql = "SELECT * FROM minecraft_srvr.contest_contests WHERE id = {$id};";
    $rst = mysql_query($sql);
    $contest = mysql_fetch_array($rst, MYSQL_ASSOC);
    $status = $contest['status'];
    if ($status !== 'active') {
        umc_error("Contest number {$id} is not active. Please chose a different contest!");
    }
    $min = array('aether' => array('x' => -1532, 'z' => -1532, 'y' => 11, 'parent' => 'aet_p1'), 'flatlands' => array('x' => 1028, 'z' => 1028, 'y' => 64, 'parent' => 'flat_b19'));
    $max = array('aether' => array('x' => -1157, 'z' => -1157, 'y' => 255), 'flatlands' => array('x' => 1275, 'z' => 1275, 'y' => 255));
    $gap = 4;
    $type = 'survival';
    $world = 'aether';
    if ($contest['type'] == 'creative') {
        $type = 'creative';
        $world = 'flatlands';
    }
    $parent = $min[$world]['parent'];
    $min_coords = $min[$world];
    $min_x = $min_coords['x'];
    $min_z = $min_coords['z'];
    $min_y = $min_coords['y'];
    if ($debug) {
        umc_echo("Min coords are {$min_x}/{$min_y}/{$min_z}");
    }
    $max_coords = $max[$world];
    $max_x = $max_coords['x'];
    $max_z = $max_coords['z'];
    $max_y = $max_coords['y'];
    if ($debug) {
        umc_echo("MAx coords are {$max_x}/{$max_y}/{$max_z}");
    }
    $user_id = umc_get_worldguard_id('user', strtolower($player));
    $world_id = umc_get_worldguard_id('world', strtolower($world));
    // find out if the user can have additional contest entries in this contest
    $sql = "SELECT * FROM minecraft_worldguard.world LEFT JOIN minecraft_worldguard.region ON world.id=region.world_id\r\n        LEFT JOIN minecraft_worldguard.region_cuboid ON region.id=region_cuboid.region_id\r\n        LEFT JOIN minecraft_worldguard.region_players ON region_cuboid.region_id=region_players.region_id\r\n        WHERE world.name='{$world}' AND region.id LIKE 'con_" . $id . "%' AND user_id={$user_id} AND Owner=1\r\n        ORDER BY max_z, max_x";
    $rst = mysql_query($sql);
    $count = mysql_num_rows($rst);
    if ($count >= $contest['max_entries'] && $player != 'uncovery') {
        umc_error("You have reached the max number of entries for this contest!;");
    }
    // find out if a contest lot already exists
    $sql = "SELECT * FROM minecraft_worldguard.world LEFT JOIN minecraft_worldguard.region ON world.id=region.world_id\r\n        LEFT JOIN minecraft_worldguard.region_cuboid ON region.id=region_cuboid.region_id\r\n        WHERE world.name='{$world}' AND region.id LIKE 'con%' ORDER BY max_z, max_x";
    $rst = mysql_query($sql);
    $count = mysql_num_rows($rst);
    if ($debug) {
        umc_echo("{$count} entries already entered!");
    }
    $lotnumber = $count + 1;
    $lot = 'con_' . $id . '_' . $lotnumber;
    if ($debug) {
        umc_echo("Trying to create entry {$lot}");
    }
    // how many lots can I fit into the space across?
    $fullwidth = $max_x - $min_x;
    if ($debug) {
        umc_echo("Lot width is {$fullwidth}");
    }
    $single_width = $contest['x'] + $gap;
    if ($debug) {
        umc_echo("One lot (with gap) is {$single_width} wide");
    }
    $width_lots = floor($fullwidth / $single_width);
    if ($debug) {
        umc_echo("Fitting {$width_lots} per line");
    }
    $fulldepth = $max_z - $min_z;
    $single_depth = $contest['z'] + $gap;
    if ($debug) {
        umc_echo("One lot (with gap) is {$single_depth} deep");
    }
    $depth_lots = floor($fulldepth / $single_depth);
    if ($debug) {
        umc_echo("Fitting {$depth_lots} per row");
    }
    $full_lines = floor($count / $width_lots);
    if ($debug) {
        umc_echo("{$full_lines} lines already full");
    }
    $lastline_lots = $count - $full_lines * $width_lots;
    if ($debug) {
        umc_echo("Last line has {$lastline_lots} lots");
    }
    $start_x = $lastline_lots * ($contest['x'] + $gap) + $min_coords['x'];
    $start_z = $full_lines * ($contest['z'] + $gap) + $min_coords['z'];
    $start_y = $min_coords['y'];
    if ($debug) {
        umc_echo("Starting coords are {$start_x}/{$start_y}/{$start_z}");
    }
    $end_x = $start_x + $contest['x'] - 1;
    $end_z = $start_z + $contest['z'] - 1;
    $end_y = $min_coords['y'] + $contest['y'] - 1;
    if ($debug) {
        umc_echo("End coords are {$end_x}/{$end_y}/{$end_z}");
    }
    if ($end_x > $max_x || $end_z > $max_z) {
        umc_error('There is no more space for additional contest entries!;');
    }
    umc_echo("New lot {gold}{$lot}{white} in {gold}{$world}{white} was created at ");
    umc_echo("coordinates {gold}{$start_x}/{$start_y}/{$start_z}{white} - {gold}{$end_x}/{$end_y}/{$end_z}{white};");
    umc_echo("Use {gold}/contest warp {$id} {$lotnumber}{white} to get there.");
    // create insert SQL 	id 	world_id 	type 	priority 	parent
    $ins_region_sql = "INSERT INTO region (id, world_id, type, priority, parent)\r\n        VALUES ('{$lot}', {$world_id}, 'cuboid', 0, '{$parent}');";
    $ins_region_rst = mysql_query($ins_region_sql);
    // insert cuboid region_id 	world_id 	min_x 	min_y 	min_z 	max_x 	max_y 	max_z
    $ins_cuboid_sql = "INSERT INTO region_cuboid (region_id, world_id, min_x, min_y, min_z, max_x, max_y, max_z)\r\n        VALUES ('{$lot}', {$world_id}, {$start_x}, {$start_y}, {$start_z}, {$end_x}, {$end_y}, {$end_z});";
    $ins_cuboid_rst = mysql_query($ins_cuboid_sql);
    // add user to lot as Owner  region_id 	world_id 	user_id 	Owner
    $ins_user_sql = "INSERT INTO region_players (region_id, world_id, user_id, Owner)\r\n        VALUES ('{$lot}', {$world_id}, {$user_id}, 1);";
    $inc_user_rst = mysql_query($ins_user_sql);
    umc_ws_cmd("region load -w {$world}", 'asConsole');
    umc_footer();
}
function umc_lot_addrem()
{
    global $UMC_USER;
    $player = $UMC_USER['username'];
    $args = $UMC_USER['args'];
    /// /lotmember lot world add target
    if (count($args) <= 3) {
        umc_echo("{red}Not enough arguments given");
        umc_show_help($args);
        return;
    }
    $addrem = $args[1];
    $lot = strtolower($args[2]);
    $action = $args[3];
    $worlds = array('emp' => 'empire', 'fla' => 'flatlands', 'dar' => 'darklands', 'aet' => 'aether', 'kin' => 'kingdom', 'dra' => 'draftlands', 'blo' => 'skyblock', 'con' => 'aether');
    $world_abr = substr($lot, 0, 3);
    if (!isset($worlds[$world_abr])) {
        umc_error("Your used an invalid lot name!");
    }
    $world = $worlds[$world_abr];
    if ($player == '@Console') {
        $player = 'uncovery';
    }
    $user_id = umc_get_worldguard_id('user', strtolower($player));
    if (!$user_id) {
        umc_error("Your user id cannot be found!");
    }
    $player_group = umc_get_userlevel($player);
    $world_id = umc_get_worldguard_id('world', $world);
    if (!$world_id) {
        umc_show_help($args);
        umc_error("The lot '{$lot}' cannot be found in any world!");
    }
    if (!umc_check_lot_exists($world_id, $lot)) {
        umc_show_help($args);
        umc_error("There is no lot {$lot} in world {$world}!");
    }
    if ($action == 'snow' || $action == 'ice') {
        // check if the user has DonatorPlus status.
        if ($player_group !== 'Owner') {
            if (!stristr($player_group, 'DonatorPlus')) {
                umc_error("You need to be DonatorPlus level to use the snow/ice features!;");
            }
            $owner_switch = 0;
            // check if player is Owner of lot
            $sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id='{$lot}' AND world_id={$world_id} AND user_id={$user_id} and Owner=1;";
            $D = umc_mysql_fetch_all($sql);
            $num = count($D);
            if ($num != 1) {
                umc_error("It appears you {$player} ({$user_id}) are not Owner of lot {$lot} in world {$world}!");
            }
        }
        // get the current status of the flags
        if ($addrem == 'add') {
            $flag = 'allow';
            umc_echo("Allowing {$action} forming on lot {$lot}... ");
        } else {
            if ($addrem == 'rem') {
                $flag = 'deny';
                umc_echo("Preventing {$action} forming on lot {$lot}... ");
            } else {
                umc_show_help($args);
            }
        }
        if ($action == 'snow') {
            $flagname = 'snow-fall';
        } else {
            if ($action == 'ice') {
                $flagname = 'ice-form';
            }
        }
        // does flag exist?
        $check_sql = "SELECT * FROM minecraft_worldguard.region_flag WHERE region_id='{$lot}' AND world_id={$world_id} AND flag='{$flagname}';";
        $D2 = umc_mysql_fetch_all($check_sql);
        $count = count($D2);
        if ($count == 0) {
            // insert
            $ins_sql = "INSERT INTO minecraft_worldguard.region_flag (region_id, world_id, flag, value) VALUES ('{$lot}', {$world_id}, '{$flagname}', '{$flag}');";
            umc_mysql_query($ins_sql, true);
        } else {
            // update
            $upd_sql = "UPDATE minecraft_worldguard.region_flag SET value='{$flag}' WHERE region_id='{$lot}' AND world_id={$world_id} AND flag='{$flagname}';";
            umc_mysql_query($upd_sql, true);
        }
        umc_echo("done!");
        umc_log('lot', 'addrem', "{$player} changed {$action} property of {$lot}");
    } else {
        if ($action == 'owner' || $action == 'give') {
            if ($player != 'uncovery' && $player != '@Console') {
                umc_error("Nice try, {$player}. Think I am stupid? Want to get banned?");
            }
            $owner_switch = 1;
        } else {
            if ($action == 'member') {
                $user_id = umc_get_worldguard_id('user', strtolower($player));
                if (!$user_id && $player !== 'uncovery') {
                    umc_error("Your user id cannot be found!");
                }
                $owner_switch = 0;
                // check if player is Owner of lot
                if ($player_group !== 'Owner') {
                    $sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id='{$lot}' AND world_id={$world_id} AND user_id={$user_id} and Owner=1;";
                    $D3 = umc_mysql_fetch_all($sql);
                    $count = count($D3);
                    if ($count != 1) {
                        umc_error("It appears you ({$player} {$user_id}) are not Owner of lot {$lot} in world {$world}!");
                    }
                }
            } else {
                umc_echo("Action {$action} not recognized!");
                umc_show_help($args);
                return;
            }
        }
        // get list of active users
        $active_users = umc_get_active_members();
        for ($i = 4; $i < count($args); $i++) {
            $target = strtolower($args[$i]);
            // check if target player exists
            $target_id = umc_get_worldguard_id('user', strtolower($target));
            if (!$target_id) {
                umc_error("The user {$target} does not exist in the database. Please check spelling of username");
            }
            if ($player != 'uncovery') {
                $targ_group = umc_get_userlevel($target);
                if ($targ_group == 'Guest') {
                    umc_error("You cannnot add Guests to your lot!;");
                } else {
                    if (!in_array($target, $active_users)) {
                        XMPP_ERROR_trigger("{$player} tried to add {$target} to his lot {$lot}, but {$target} is not an active member!");
                        umc_error("{$target} is not an active user! You can only add people who have their own lot! See FAQ entry #32 please.");
                    }
                }
            }
            // add / remove target player from lot
            if ($addrem == 'add') {
                // make sure target is not already there
                $sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id='{$lot}' AND world_id={$world_id} AND user_id={$target_id};";
                $D3 = umc_mysql_fetch_all($sql);
                $num = count($D3);
                if ($num == 1) {
                    umc_error("It appears {$target} is already member of lot {$lot} in world {$world}!");
                }
                // add to the lot
                umc_lot_add_player($target, $lot, 0);
                umc_echo("Added {$target} to {$lot} in the {$world}!");
            } else {
                if ($addrem == 'rem') {
                    // check if target is there at all
                    $sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id='{$lot}' AND world_id={$world_id} AND user_id={$target_id} AND Owner={$owner_switch} LIMIT 1;";
                    $D3 = umc_mysql_fetch_all($sql);
                    $num = count($D3);
                    if ($num !== 1) {
                        umc_error("It appears user {$target} is not a member of lot {$lot} in world {$world}!");
                    }
                    umc_lot_rem_player($target, $lot, 0);
                    umc_echo("Removed {$target} from {$lot} in the {$world}!");
                } else {
                    if ($addrem == 'give') {
                        // remove all members and owners
                        umc_lot_remove_all($lot);
                        umc_lot_add_player($target, $lot, 1);
                        umc_echo("Gave {$lot} to {$target} in the {$world}! All other user removed!");
                        // logfile entry
                        umc_log('lot', 'addrem', "{$player} gave lot to {$target}");
                    } else {
                        umc_show_help($args);
                    }
                }
            }
        }
    }
    umc_ws_cmd("region load -w {$world}", 'asConsole');
}
function umc_skyblock_abandon()
{
    global $UMC_USER;
    $player = $UMC_USER['username'];
    $args = $UMC_USER['args'];
    if (!isset($args[2])) {
        umc_show_help($args);
        die;
    } else {
        $lot = umc_sanitize_input($args[2], 'lot');
        $check = umc_check_lot_exists('skyblock', $lot);
        if (!$check) {
            umc_error("The lot you entered does not exist!");
        }
        if ($lot == 'block_k11') {
            umc_error('You cannot warp to that lot!');
        }
    }
    //check if the user abandoned already
    $abandon_id = umc_get_worldguard_id('user', '_abandoned_');
    $abandon_sql = "SELECT * FROM minecraft_worldguard.region_players WHERE region_id = '{$lot}' AND Owner=1 AND user_id={$abandon_id};";
    $D3 = umc_mysql_fetch_all($abandon_sql);
    $num = count($D3);
    if ($num > 0) {
        umc_error("You abandoned the entry {$lot} already!");
    }
    // make sure the user actually owns this enrty
    $user_id = umc_get_worldguard_id('user', strtolower($player));
    // find out if the user can have additional contest entries in this contest
    $sql = "SELECT * FROM minecraft_worldguard.world LEFT JOIN minecraft_worldguard.region ON world.id=region.world_id\r\n        LEFT JOIN minecraft_worldguard.region_cuboid ON region.id=region_cuboid.region_id\r\n        LEFT JOIN minecraft_worldguard.region_players ON region_cuboid.region_id=region_players.region_id\r\n        LEFT JOIN minecraft_worldguard.user ON region_players.user_id=user.id\r\n        WHERE region.id LIKE '{$lot}' AND Owner=1 AND user.id={$user_id}";
    $D = umc_mysql_fetch_all($sql);
    if (count($D) != 1) {
        umc_error("You do not own the lot {$lot} in skyblock!");
    } else {
        $row = $D[0];
    }
    $world_id = $row['world_id'];
    $ins_user_sql = "INSERT INTO minecraft_worldguard.region_players (region_id, world_id, user_id, Owner)\r\n        VALUES ('{$lot}', {$world_id}, {$abandon_id}, 1);";
    umc_mysql_query($ins_user_sql, true);
    umc_ws_cmd('region load -w skyblock', 'asConsole');
    umc_echo("You have succcessfully abandoned the lot {$lot}! It will be reset with the next reboot. You can then register a new one!");
}