2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
2018-03-09 02:13:08 +00:00
|
|
|
|
/**
|
|
|
|
|
* Центральная площадь
|
|
|
|
|
*/
|
2018-01-28 16:40:49 +00:00
|
|
|
|
session_start();
|
2020-09-30 12:30:00 +00:00
|
|
|
|
if (empty($_SESSION['uid'])) {
|
2018-02-12 19:53:19 +00:00
|
|
|
|
header("Location: index.php");
|
2020-09-29 22:39:06 +00:00
|
|
|
|
exit;
|
2018-02-12 19:53:19 +00:00
|
|
|
|
}
|
2020-09-30 12:30:00 +00:00
|
|
|
|
|
2020-09-29 22:39:06 +00:00
|
|
|
|
require_once "functions.php";
|
|
|
|
|
$user = $user ?? [];
|
2018-01-28 16:40:49 +00:00
|
|
|
|
|
2020-09-29 22:39:06 +00:00
|
|
|
|
if ($user->battle) {
|
2018-02-12 19:53:19 +00:00
|
|
|
|
header('location: fbattle.php');
|
2020-09-29 22:39:06 +00:00
|
|
|
|
exit;
|
2018-02-12 19:53:19 +00:00
|
|
|
|
}
|
2020-09-29 22:39:06 +00:00
|
|
|
|
if ($user->in_tower == 1) {
|
2018-02-12 19:53:19 +00:00
|
|
|
|
header('Location: towerin.php');
|
2020-09-29 22:39:06 +00:00
|
|
|
|
exit;
|
2018-02-12 19:53:19 +00:00
|
|
|
|
}
|
2020-09-29 22:39:06 +00:00
|
|
|
|
if ($user->zayavka) {
|
|
|
|
|
exit;
|
2018-02-12 19:53:19 +00:00
|
|
|
|
}
|
2018-01-28 16:40:49 +00:00
|
|
|
|
|
2020-10-26 18:16:28 +00:00
|
|
|
|
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
|
2018-03-09 14:53:10 +00:00
|
|
|
|
$location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
2020-10-26 18:16:28 +00:00
|
|
|
|
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[0]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'cp':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(20,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'strah':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(21,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'bps':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(26,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'ps':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(51,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'zaliv':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2111,$user->room);
|
2018-03-09 14:54:54 +00:00
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'zamk':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2601,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'abog':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2655,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'torg':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2702,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'got':
|
2020-09-30 12:01:33 +00:00
|
|
|
|
if ($user->room == 20) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level1':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(1,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level7':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(21,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level8':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(26,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level13':
|
|
|
|
|
header('location: quest_room.php');
|
|
|
|
|
break;
|
|
|
|
|
case 'level222':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2702,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level17':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(50,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level2':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(22,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level4':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(23,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level6':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(27,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level3':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(25,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 21) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level4':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(20,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level3':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2111,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level13':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(34,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level5':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(29,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level16':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(31,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level14':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(30,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level650':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(650,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 2111) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level1':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(21,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level203':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(1055,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level1000':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(620,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'room666':
|
2020-10-27 00:36:29 +00:00
|
|
|
|
//Нет на карте
|
2020-10-28 20:21:08 +00:00
|
|
|
|
//Battles\Travel::toRoom(666,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 2601) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level4':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(26,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level55':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2655,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level1':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(37,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level1051':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(1051,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level5':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(404,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 2701) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level1':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2111,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level2':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(402,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 2702) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level10':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(20,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level6':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(61,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 2655) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level10':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2601,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level2055':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(603,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2020-09-30 12:01:33 +00:00
|
|
|
|
} elseif ($user->room == 26) {
|
2018-03-09 14:53:10 +00:00
|
|
|
|
switch ($location[1]) {
|
2020-10-26 18:16:28 +00:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
case 'level4':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(20,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level3':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(2601,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level660':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(660,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'level7':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(777,$user->room);
|
2018-03-09 14:53:10 +00:00
|
|
|
|
break;
|
2019-01-18 19:56:07 +00:00
|
|
|
|
case 'level56':
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\Travel::toRoom(401,$user->room);
|
2019-01-18 19:56:07 +00:00
|
|
|
|
break;
|
2018-03-09 14:53:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-09 02:13:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-28 20:21:08 +00:00
|
|
|
|
\Battles\Template::header('city');
|
2020-10-26 18:16:28 +00:00
|
|
|
|
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 Торговая
|
|
|
|
|
*/
|
2020-10-28 20:21:08 +00:00
|
|
|
|
Battles\City::showStreet($user->room);
|
2020-10-26 18:16:28 +00:00
|
|
|
|
}
|