<?php
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://'; $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost:8000'; $scriptName = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '/index.php'; $rootBasePath = rtrim(dirname(dirname(dirname($scriptName))), '/\\'); if (empty($rootBasePath) || $rootBasePath === '.' || $rootBasePath === '/') { $rootBasePath = ''; } define('BASE_URL', rtrim($protocol . $host . $rootBasePath, '/')); define('BASE_PATH', dirname(dirname(__DIR__))); define('CONFIG_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'utils'); $userDataPath = getenv('TORRENT_EMPIRE_USER_DATA'); if ($userDataPath !== false && !empty($userDataPath)) { define('DATABASE_PATH', $userDataPath . DIRECTORY_SEPARATOR . 'database'); } else { define('DATABASE_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'database'); } define('SCHEMA_PATH', DATABASE_PATH . DIRECTORY_SEPARATOR . 'schema.sql'); define('DB_PATH', DATABASE_PATH . DIRECTORY_SEPARATOR . 'game.db'); define('SRC_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'src'); define('LANGUAGES_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'languages'); define('PUBLIC_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'public'); define('ASSETS_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'assets'); define('API_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'api'); define('ASSETS_URL', BASE_URL . '/assets'); define('PUBLIC_URL', BASE_URL . '/public'); define('API_URL', BASE_URL . '/src/api'); define('LANGUAGES_URL', BASE_URL . '/languages'); define('GAME_VERSION', '1.0.0'); define('INITIAL_CREDITS', 1000); define('BASE_ATTENTION_INCREASE', 0.1); define('ATTENTION_MAX', 100); define('CRYPTO_UPDATE_INTERVAL', 300); define('DIFFICULTY_EASY', 1); define('DIFFICULTY_MEDIUM', 2); define('DIFFICULTY_HARD', 3); define('GAME_CODE_BREAKING', 1); define('GAME_PATTERN_RECOGNITION', 2); define('GAME_MEMORY_CHALLENGE', 3); define('AD_BANNER', 1); define('AD_POPUP', 2); define('AD_MISLEADING', 3); define('SECURITY_BASIC', 1); define('SECURITY_ADVANCED', 2); define('SECURITY_EXPERT', 3); define('COLOR_PRIMARY', '#00ff00'); define('COLOR_BACKGROUND', '#000000'); define('COLOR_WARNING', '#ff0000'); define('COLOR_SUCCESS', '#00ff00'); define('COLOR_INFO', '#0000ff'); 