Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.
This commit is contained in:
+15
-2
@@ -4,7 +4,10 @@
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
ini_set('display_errors', 'On');
|
||||
error_reporting(E_ALL);
|
||||
define("GAMEDOMAIN", "battles.lan");
|
||||
@@ -28,7 +31,7 @@ require_once 'classes/Database/db.php';
|
||||
* Автозагрузка классов с учётом неймспейсов.
|
||||
*/
|
||||
|
||||
spl_autoload_register(function ($className){
|
||||
spl_autoload_register(function ($className) {
|
||||
$fileName = __DIR__ . '/classes/' . str_replace('\\', '/', $className . '.php');
|
||||
if (file_exists($fileName)) {
|
||||
require_once $fileName;
|
||||
@@ -204,4 +207,14 @@ trait Config
|
||||
1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень
|
||||
];
|
||||
public static $cavedata = [621 => ['x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1, 'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
|
||||
|
||||
//DB
|
||||
protected static $db = [
|
||||
'host' => '192.168.20.5',
|
||||
'name' => 'battles',
|
||||
'user' => 'battles',
|
||||
'password' => 'bottle-neck-horse',
|
||||
'port' => 32101,
|
||||
'charset' => 'utf8',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user