function umc_mod_warp_lot() { global $UMC_USER; $args = $UMC_USER['args']; if (!isset($args[2])) { umc_show_help($args); die; } $lot = strtolower($args[2]); $world = umc_get_lot_world($lot); $playerworld = $UMC_USER['world']; if ($world != $playerworld) { umc_ws_cmd("mv tp {$world}", 'asPlayer'); } $sql = "SELECT min_x, min_z FROM minecraft_worldguard.`region_cuboid` WHERE region_id='{$lot}';"; $D = umc_mysql_fetch_all($sql); $row = $D[0]; $x = $row['min_x']; $z = $row['min_z']; $y = 70; umc_ws_cmd("tppos {$x} {$y} {$z} 135", 'asPlayer'); }
function umc_restore_from_backup() { XMPP_ERROR_trace(__FUNCTION__, func_get_args()); global $UMC_PATH_MC; // king_s11_b, king_r11_a, king_r11_b, king_q11_a, king_q11_b, king_p11_a, king_p11_b, king_o11_a, king_o11_b, king_n11_a, king_n11_b, and king_n12_c. // emp_k7, emp_j7, king_h21_a, king_h22, king_h22_c, king_g22, king_h22_a, king h22_b, king_g22_a, king_h23, king_h23_c, and king_g23. $lots = array('king_s9' => 'f1', 'king_s9_b' => 'f1', 'king_s9_c' => 'f1', 'king_s8_a' => 'f1', 'king_s8_b' => 'f1', 'king_s8_c' => 'f1', 'king_s10_b' => 'f1', 'king_s10_c' => 'f1', 'king_s11_b' => 'f1', 'king_s11_c' => 'f1', 'king_r9' => 'f1', 'king_r9_a' => 'f1', 'king_r8_a' => 'f1', 'king_r8_b' => 'f1', 'king_r11_b' => 'f1', 'king_r15_b' => 'psychodrea', 'king_r11_a' => 'f1', 'king_r10' => 'f1', 'king_q16' => 'psychodrea', 'king_q15' => 'psychodrea', 'king_q15_a' => 'psychodrea', 'king_q14_a' => 'psychodrea', 'king_q14' => 'psychodrea', 'king_q11_a' => 'f1', 'king_q11_b' => 'f1', 'king_p13' => 'butifuldzastr', 'king_p11_a' => 'f1', 'king_p11_b' => 'f1', 'king_n11_b' => 'f1', 'king_n12_c' => 'f1', 'king_o11_a' => 'f1', 'king_o11_b' => 'f1', 'king_i22_c' => 'chenoa', 'king_n11_a' => 'f1', 'king_h23' => 'chenoa', 'king_h23_c' => 'chenoa', 'king_h22_c' => 'chenoa', 'king_h22' => 'chenoa', 'king_h22_a' => 'chenoa', 'king_h22_b' => 'chenoa', 'king_g23' => 'chenoa', 'king_h21_a' => 'chenoa', 'king_g22' => 'chenoa', 'king_g22_a' => 'chenoa', 'emp_x9' => 'patpat2211', 'emp_w17' => 'dueldragonoid', 'emp_w9' => 'patpat2211', 'emp_x10' => 'patpat2211', 'emp_v19' => 'dueldragonoid', 'emp_w10' => 'patpat2211', 'emp_t8' => 'silver82', 'emp_u7' => 'silver82', 'emp_u8' => 'silver82', 'emp_q6' => 'azjaguar', 'emp_q7' => 'azjaguar', 'emp_t7' => 'silver82', 'emp_q11' => 'doriryo92', 'emp_q20' => 'cyanlaser121', 'emp_p7' => 'azjaguar', 'emp_o4' => 'nerfherd315', 'emp_p6' => 'mrturtl3_97', 'emp_m22' => 'psychodrea', 'emp_m23' => 'psychodrea', 'emp_n22' => 'psychodrea', 'emp_n23' => 'psychodrea', 'emp_j7' => 'chenoa', 'emp_k7' => 'chenoa', 'emp_m20' => 'zataros', 'emp_i17' => 'f1', 'emp_j17' => 'bissellc', 'emp_h17' => 'f1', 'emp_ac6' => 'pilotrange', 'emp_f15' => 'pilotrange', 'emp_aa18' => 'butifuldzastr', 'emp_ab21' => 'masetrix', 'block_g7' => 'zataros', 'block_g9' => 'psychodrea', 'aet_g8' => 'nerfherd315', 'aet_j12' => 'mattdholloway', 'aet_f11' => 'f1', 'aet_d6' => 'azjaguar', 'aet_a12' => 'psychodrea', 'aet_a5' => 'dueldragonoid', 'emp_g27' => 'uncovery'); $source_folder = "/disk2/tmp/minecraft/server/worlds/save/"; $dest_folder = "{$UMC_PATH_MC}/server/bukkit/"; foreach ($lots as $lot => $owner) { echo "processing lot {$lot}\n"; umc_lot_add_player($owner, $lot, 1); $world = umc_get_lot_world($lot); if (!$world) { die("World of lot {$lot} could not be found!"); } //echo "Restoring with $lot, $source_folder . $world, $lot, $dest_folder . $world"; umc_move_chunks($lot, $source_folder . $world, $lot, $dest_folder . $world, true); } }
function umc_lot_warp() { global $UMC_USER; $player = $UMC_USER['username']; $userlevel = $UMC_USER['userlevel']; $world = $UMC_USER['world']; $args = $UMC_USER['args']; $allowed_ranks = array('Owner', 'Guest'); if (!in_array($userlevel, $allowed_ranks)) { umc_error("Sorry, this command is only for Guests!"); } $allowed_worlds = array('empire', 'flatlands'); if (!in_array($world, $allowed_worlds)) { umc_error('Sorry, you need to be in the Empire or Flatlands to warp!'); } else { $lot = strtolower(umc_sanitize_input($args[2], 'lot')); // the above one fails already if the lot is not a proper lot $target_world = umc_get_lot_world($lot); if (!in_array($target_world, $allowed_worlds)) { umc_error('Sorry, you need to be in the Empire or Flatlands to warp!'); } if ($target_world != $world) { umc_error("Sorry, you need to be in {$target_world} to warp to {$lot}!"); } } $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='{$target_world}' AND region.id = '{$lot}' "; $D = umc_mysql_fetch_all($sql); if (count($D) != 1) { umc_error("There was an error teleporting you to your lot, the admin was notified, please wait for it to be fixed!"); } $lots = $D[0]; $c_x = $lots['min_x'] + 64; $c_z = $lots['min_z'] + 64; $c_y = 256; $cmd = "tppos {$player} {$c_x} {$c_y} {$c_z} 0"; umc_ws_cmd($cmd, 'asConsole'); umc_pretty_bar("darkblue", "-", "{darkcyan} Warping to lot {$lot}"); umc_echo("You are now in the center of lot {$lot}!"); umc_footer(); }