229 lines
6.9 KiB
PHP
229 lines
6.9 KiB
PHP
<?php
|
||
/**
|
||
* Центральная площадь
|
||
*/
|
||
session_start();
|
||
if (empty($_SESSION['uid'])) {
|
||
header("Location: index.php");
|
||
exit;
|
||
}
|
||
|
||
require_once "functions.php";
|
||
$user = $user ?? [];
|
||
|
||
if ($user->battle) {
|
||
header('location: fbattle.php');
|
||
exit;
|
||
}
|
||
if ($user->in_tower == 1) {
|
||
header('Location: towerin.php');
|
||
exit;
|
||
}
|
||
if ($user->zayavka) {
|
||
exit;
|
||
}
|
||
|
||
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
|
||
$location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
||
|
||
switch ($location[0]) {
|
||
default:
|
||
break;
|
||
case 'cp':
|
||
Travel::toRoom(20);
|
||
break;
|
||
case 'strah':
|
||
Travel::toRoom(21);
|
||
break;
|
||
case 'bps':
|
||
Travel::toRoom(26);
|
||
break;
|
||
case 'ps':
|
||
Travel::toRoom(51);
|
||
break;
|
||
case 'zaliv':
|
||
Travel::toRoom(2111);
|
||
break;
|
||
case 'zamk':
|
||
Travel::toRoom(2601);
|
||
break;
|
||
case 'abog':
|
||
Travel::toRoom(2655);
|
||
break;
|
||
case 'torg':
|
||
Travel::toRoom(2702);
|
||
break;
|
||
case 'got':
|
||
if ($user->room == 20) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level1':
|
||
header('location: main.php?goto=arena');
|
||
exit;
|
||
break;
|
||
case 'level7':
|
||
Travel::toRoom(21,$user->room);
|
||
break;
|
||
case 'level8':
|
||
Travel::toRoom(26,$user->room);
|
||
break;
|
||
case 'level13':
|
||
header('location: quest_room.php');
|
||
break;
|
||
case 'level222':
|
||
Travel::toRoom(2702,$user->room);
|
||
break;
|
||
case 'level17':
|
||
Travel::toRoom(50,$user->room);
|
||
break;
|
||
case 'level2':
|
||
Travel::toRoom(22,$user->room);
|
||
break;
|
||
case 'level4':
|
||
Travel::toRoom(23,$user->room);
|
||
break;
|
||
case 'level6':
|
||
Travel::toRoom(27,$user->room);
|
||
break;
|
||
case 'level3':
|
||
Travel::toRoom(25,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 21) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level4':
|
||
Travel::toRoom(20,$user->room);
|
||
break;
|
||
case 'level3':
|
||
Travel::toRoom(2111,$user->room);
|
||
break;
|
||
case 'level13':
|
||
Travel::toRoom(34,$user->room);
|
||
break;
|
||
case 'level5':
|
||
Travel::toRoom(29,$user->room);
|
||
break;
|
||
case 'level16':
|
||
Travel::toRoom(31,$user->room);
|
||
break;
|
||
case 'level14':
|
||
Travel::toRoom(30,$user->room);
|
||
break;
|
||
case 'level650':
|
||
Travel::toRoom(650,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 2111) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level1':
|
||
Travel::toRoom(21,$user->room);
|
||
break;
|
||
case 'level2':
|
||
header('location: city.php?haos');
|
||
break;
|
||
case 'level203':
|
||
Travel::toRoom(1055,$user->room);
|
||
break;
|
||
case 'level1000':
|
||
Travel::toRoom(620,$user->room);
|
||
break;
|
||
case 'room666':
|
||
Travel::toRoom(666,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 2601) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level4':
|
||
Travel::toRoom(26,$user->room);
|
||
break;
|
||
case 'level55':
|
||
Travel::toRoom(2655,$user->room);
|
||
break;
|
||
case 'level1':
|
||
Travel::toRoom(37,$user->room);
|
||
break;
|
||
case 'level1051':
|
||
Travel::toRoom(1051,$user->room);
|
||
break;
|
||
case 'level5':
|
||
Travel::toRoom(404,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 2701) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level1':
|
||
Travel::toRoom(2111,$user->room);
|
||
break;
|
||
case 'level2':
|
||
Travel::toRoom(402,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 2702) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level10':
|
||
Travel::toRoom(20,$user->room);
|
||
break;
|
||
case 'level6':
|
||
Travel::toRoom(61,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 2655) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level10':
|
||
Travel::toRoom(2601,$user->room);
|
||
break;
|
||
case 'level2055':
|
||
Travel::toRoom(603,$user->room);
|
||
break;
|
||
}
|
||
} elseif ($user->room == 26) {
|
||
switch ($location[1]) {
|
||
default:
|
||
break;
|
||
case 'level4':
|
||
Travel::toRoom(20,$user->room);
|
||
break;
|
||
case 'level3':
|
||
Travel::toRoom(2601,$user->room);
|
||
break;
|
||
case 'level660':
|
||
Travel::toRoom(660,$user->room);
|
||
break;
|
||
case 'level7':
|
||
Travel::toRoom(777,$user->room);
|
||
break;
|
||
case 'level56':
|
||
Travel::toRoom(401,$user->room);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
Template::header('city');
|
||
echo sprintf('<div style="text-align: right;">Сейчас в игре: %s игроков.></div>', $online->getNumRows());
|
||
if (in_array($user->room, [20, 21, 26, 2601, 2655, 2111, 2701, 2702])) {
|
||
/* Улицы:
|
||
* 20 Центральная
|
||
* 21 Страшилкина
|
||
* 26 Парковая
|
||
* 2601 Замковая
|
||
* 2655 С ареной
|
||
* 2111 С ристалищем
|
||
* 2701 С ещё одним ристалищем?
|
||
* 2702 Торговая
|
||
*/
|
||
City::showStreet($user->room);
|
||
} |