Перенос проверки какой скрипт подгружать игроку в глобальное пространство.

This commit is contained in:
Igor Barkov (iwork) 2019-09-17 16:57:28 +03:00
parent 9835e2368e
commit 7ecaf3ae7e
2 changed files with 172 additions and 172 deletions

View File

@ -44,7 +44,7 @@ function createbot($bot, $login = "")
}
}
#####Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонаж на которого нельзя напасть.
/* === Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонаж на которого нельзя напасть. === */
$unkilable = [
'rooms' => [620, 621, 1051, 1052],
'users' => [10962, 10964, 10965]
@ -54,6 +54,177 @@ $canalenters = [620];
$caverooms = [621];
$userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
/* === проверяем соответствие комнаты и скрипта === */
if (in_array($user['room'], [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
header('Location: city.php');
die();
}
if ($user['room'] == 22) {
header('Location: shop.php');
die();
}
if ($user['room'] == 23) {
header('Location: repair.php');
die();
}
if ($user['room'] == 25) {
header('Location: comission.php');
die();
}
if ($user['room'] == 27) {
header('Location: post.php');
die();
}
if ($user['room'] == 29) {
header('Location: bank.php');
die();
}
if ($user['room'] == 31) {
header('Location: tower.php');
die();
}
if ($user['room'] == 30) {
header('Location: clan_create.php');
die();
}
if ($user['room'] == 34) {
header('Location: fshop.php');
die();
}
if ($user['room'] == 42) {
header('Location: lotery.php');
die();
}
if ($user['room'] == 43) {
header('Location: znahar.php');
die();
}
if ($user['room'] == 44) {
header('Location: new_year.php');
die();
}
if ($user['room'] == 45) {
header('Location: clan_castle.php');
die();
}
if ($user['room'] == 47) {
header('Location: wall_build.php');
die();
}
if ($user['room'] == 49) {
header('Location: dig.php');
die();
}
if ($user['room'] == 50) {
header('Location: ashop.php');
die();
}
if ($user['room'] == 53) {
header('Location: library.php');
die();
}
if ($user['room'] == 61) {
header('Location: akadem.php');
die();
}
if ($user['room'] == 650) {
header('Location: ul_clans.php');
die();
}
if ($user['room'] == 222 OR $user['room'] == 223 OR $user['room'] == 224) {
header('Location: bench.php');
die();
}
//БС
if ($user['in_tower'] == 1) {
header('Location: towerin.php');
die();
}
//Храм древнх
if ($user['room'] == 203) {
header('Location: church.php');
die();
}
//ЦХ
if ($user['room'] == 600) {
header('Location: c_haos.php');
die();
}
if ($user['room'] == 601) {
header('Location: c_haos_in.php');
die();
}
if ($user['room'] == 602) {
header('Location: c_park.php');
die();
}
if ($user['room'] == 603) {
header('Location: aren_of_angels.php');
die();
}
if ($user['room'] == 620) {
header('Location: enter_cave.php');
die();
}
if ($user['room'] == 621) {
header('Location: cave.php');
die();
}
if ($user['room'] == 660) {
header('Location: hostel.php');
die();
}
if ($user['room'] == 661) {
header('Location: hostel_room.php');
die();
}
if ($user['room'] == 662) {
header('Location: quest_room.php');
die();
}
if ($user['room'] == 760) {
header('Location: c_forest.php');
die();
}
if ($user['room'] == 1000) {
header('Location: solib/enterbezdna.php');
die();
}
if ($user['room'] == 1001) {
header('Location: solib/dungeon.php');
die();
}
if ($user['room'] == 1051) {
header('Location: lab_enter.php');
die();
}
if ($user['room'] == 1052) {
header('Location: labirint.php');
die();
}
if ($user['room'] == 402) {
header('Location: vxod.php');
die();
}
if ($user['room'] == 403) {
header('Location: canalizaciya.php');
die();
}
if ($user['room'] == 1054) {
header('Location: fontan_luck.php');
die();
}
if ($user['room'] == 1055) {
header('Location: group_arena.php');
die();
}
if ($user['room'] == 666) {
header('Location: jail.php');
die();
}
function getuserdata($id = 0)
{
if (!$id) $id = isset($_SESSION['uid']) ? $_SESSION['uid'] : null; // Хорошее решение проверок, кстати.

171
main.php
View File

@ -1351,177 +1351,6 @@ if (input::get('edit')) {
}
//==========================================================================================================
//проверяем соответствие комнаты и скрипта
if (in_array($user['room'], [20, 21, 26, 48, 51, 52, 651, 2655, 2601, 2701, 2702, 2111], 1)) {
header('Location: city.php');
die();
}
if ($user['room'] == 22) {
header('Location: shop.php');
die();
}
if ($user['room'] == 23) {
header('Location: repair.php');
die();
}
if ($user['room'] == 25) {
header('Location: comission.php');
die();
}
if ($user['room'] == 27) {
header('Location: post.php');
die();
}
if ($user['room'] == 29) {
header('Location: bank.php');
die();
}
if ($user['room'] == 31) {
header('Location: tower.php');
die();
}
if ($user['room'] == 30) {
header('Location: clan_create.php');
die();
}
if ($user['room'] == 34) {
header('Location: fshop.php');
die();
}
if ($user['room'] == 42) {
header('Location: lotery.php');
die();
}
if ($user['room'] == 43) {
header('Location: znahar.php');
die();
}
if ($user['room'] == 44) {
header('Location: new_year.php');
die();
}
if ($user['room'] == 45) {
header('Location: clan_castle.php');
die();
}
if ($user['room'] == 47) {
header('Location: wall_build.php');
die();
}
if ($user['room'] == 49) {
header('Location: dig.php');
die();
}
if ($user['room'] == 50) {
header('Location: ashop.php');
die();
}
if ($user['room'] == 53) {
header('Location: library.php');
die();
}
if ($user['room'] == 61) {
header('Location: akadem.php');
die();
}
if ($user['room'] == 650) {
header('Location: ul_clans.php');
die();
}
if ($user['room'] == 222 OR $user['room'] == 223 OR $user['room'] == 224) {
header('Location: bench.php');
die();
}
//БС
if ($user['in_tower'] == 1) {
header('Location: towerin.php');
die();
}
//Храм древнх
if ($user['room'] == 203) {
header('Location: church.php');
die();
}
//ЦХ
if ($user['room'] == 600) {
header('Location: c_haos.php');
die();
}
if ($user['room'] == 601) {
header('Location: c_haos_in.php');
die();
}
if ($user['room'] == 602) {
header('Location: c_park.php');
die();
}
if ($user['room'] == 603) {
header('Location: aren_of_angels.php');
die();
}
if ($user['room'] == 620) {
header('Location: enter_cave.php');
die();
}
if ($user['room'] == 621) {
header('Location: cave.php');
die();
}
if ($user['room'] == 660) {
header('Location: hostel.php');
die();
}
if ($user['room'] == 661) {
header('Location: hostel_room.php');
die();
}
if ($user['room'] == 662) {
header('Location: quest_room.php');
die();
}
if ($user['room'] == 760) {
header('Location: c_forest.php');
die();
}
if ($user['room'] == 1000) {
header('Location: solib/enterbezdna.php');
die();
}
if ($user['room'] == 1001) {
header('Location: solib/dungeon.php');
die();
}
if ($user['room'] == 1051) {
header('Location: lab_enter.php');
die();
}
if ($user['room'] == 1052) {
header('Location: labirint.php');
die();
}
if ($user['room'] == 402) {
header('Location: vxod.php');
die();
}
if ($user['room'] == 403) {
header('Location: canalizaciya.php');
die();
}
if ($user['room'] == 1054) {
header('Location: fontan_luck.php');
die();
}
if ($user['room'] == 1055) {
header('Location: group_arena.php');
die();
}
if ($user['room'] == 666) {
header('Location: jail.php');
die();
}
?>
<HTML>
<HEAD>