diff --git a/index.php b/index.php
index 01cf01c..4ff1fc7 100644
--- a/index.php
+++ b/index.php
@@ -5,12 +5,11 @@
require ("src/lgsl_config.php");
require ("src/lgsl_language.php");
- $_COOKIE['lgsl_lang'] = $_COOKIE['lgsl_lang'] ?? tltneon\LGSL\Lang::EN;
- $lang = new tltneon\LGSL\Lang($_COOKIE['lgsl_lang']);
+ $lang = new tltneon\LGSL\Lang($_COOKIE['lgsl_lang'] ?? tltneon\LGSL\Lang::EN);
if (empty($lgsl_config['installed'])) header("Location: install.php");
global $output, $title;
- function load_page($file) {
+ function loadPage($file) {
global $lgsl_config;
if ($lgsl_config['preloader']) {
$loader = @file_get_contents('src/other/loader.html');
@@ -55,9 +54,9 @@ function alertContents() {
$s = $_GET['s'] ?? null;
$ip = $_GET['ip'] ?? null;
$port = $_GET['port'] ?? null;
- if ($s === "add") { $output = load_page("add"); $title .= " | {$lang->get("aas")}";}
- elseif ((int) $s > 0 || $ip && $port) { $output = load_page("details"); }
- else { $output = load_page("list"); }
+ if ($s === "add") { $output = loadPage("add"); $title .= " | {$lang->get("aas")}";}
+ elseif ((int) $s > 0 || $ip && $port) { $output = loadPage("details"); }
+ else { $output = loadPage("list"); }
//------------------------------------------------------------------------------------------------------------+
?>
diff --git a/src/lgsl_details.php b/src/lgsl_details.php
index 6145431..e69e95e 100644
--- a/src/lgsl_details.php
+++ b/src/lgsl_details.php
@@ -109,9 +109,10 @@
}
}
+ $iframeLink = "src/lgsl_zone.php?{$g}&bg=transparent&text=white&link=yellow";
$output .= "
-
-
+
+
diff --git a/src/lgsl_protocol.php b/src/lgsl_protocol.php
index 414a2a9..577f05e 100644
--- a/src/lgsl_protocol.php
+++ b/src/lgsl_protocol.php
@@ -603,12 +603,9 @@ public function process() {
}
}
- if (!empty($this->_data['e']['hostname'])) { $this->_data['s']['name'] = $this->_data['e']['hostname']; }
- if (!empty($this->_data['e']['sv_hostname'])) { $this->_data['s']['name'] = Helper::lgslParseColor($this->_data['e']['sv_hostname'], "1"); }
- if (isset($this->_data['e']['protocol']) && $type !== PROTOCOL::UNVANQUISHED) {
- if ($type === PROTOCOL::CALLOFDUTYIW) {
- $games = ['1' => 'IW6', '2' => 'H1', '6' => 'IW3', '7' => 'T7', '20604' => 'IW5', '151' => 'IW4', '101' => 'T4'];
- }
+ $this->_data['s']['name'] = $this->_data['e']['hostname'] ?? $this->_data['e']['sv_hostname'] ?? LGSL::NONE;
+ if (isset($this->_data['e']['protocol']) && $type === PROTOCOL::CALLOFDUTYIW) {
+ $games = ['1' => 'IW6', '2' => 'H1', '6' => 'IW3', '7' => 'T7', '20604' => 'IW5', '151' => 'IW4', '101' => 'T4'];
$this->_data['s']['game'] = $games[$this->_data['e']['protocol']] ?? "Unknown {$this->_data['e']['protocol']}";
}
if (isset($this->_data['e']['gamename'])) { $this->_data['s']['game'] = $this->_data['e']['gamename']; }
@@ -620,13 +617,10 @@ public function process() {
}
$this->_data['s']['mode'] = $games[$this->_data['e']['g_gametype']] ?? $this->_data['e']['g_gametype'];
}
- if (isset($this->_data['e']['mapname'])) { $this->_data['s']['map'] = $this->_data['e']['mapname']; }
+ $this->_data['s']['map'] = $this->_data['e']['mapname'] ?? LGSL::NONE;
$this->_data['s']['players'] = empty($part['2']) ? 0 : count($part) - 2;
- if (isset($this->_data['e']['maxclients'])) { $this->_data['s']['playersmax'] = $this->_data['e']['maxclients']; } // QUAKE 2
- if (isset($this->_data['e']['sv_maxclients'])) { $this->_data['s']['playersmax'] = $this->_data['e']['sv_maxclients']; }
- if (isset($this->_data['e']['pswrd'])) { $this->_data['s']['password'] = $this->_data['e']['pswrd']; } // CALL OF DUTY
- if (isset($this->_data['e']['needpass'])) { $this->_data['s']['password'] = $this->_data['e']['needpass']; } // QUAKE 2
- if (isset($this->_data['e']['g_needpass'])) { $this->_data['s']['password'] = (int) $this->_data['e']['g_needpass']; }
+ $this->_data['s']['playersmax'] = $this->_data['e']['maxclients'] ?? $this->_data['e']['sv_maxclients'] ?? 0;
+ $this->_data['s']['password'] = $this->_data['e']['pswrd'] ?? $this->_data['e']['needpass'] ?? (int) $this->_data['e']['g_needpass'] ?? 0;
array_shift($part); // REMOVE HEADER
array_shift($part); // REMOVE SETTING
diff --git a/src/lgsl_zone.php b/src/lgsl_zone.php
index cbfe338..ebbfbbe 100644
--- a/src/lgsl_zone.php
+++ b/src/lgsl_zone.php
@@ -14,17 +14,19 @@
$port = (int) ($_GET['port'] ?? 0);
if (!isset($lgsl_zone_number) && !$ip && !$port) { exit("LGSL PROBLEM: $lgsl_zone_number NOT SET"); }
$background = $_GET['bg'] ?? '#FFF';
- $font = $_GET['font'] ?? '#000';
+ $text = $_GET['text'] ?? '#000';
$link = $_GET['link'] ?? '#0000ED';
require "lgsl_class.php";
+ require "lgsl_language.php";
+ $lang = new Lang($_COOKIE['lgsl_lang'] ?? Lang::EN);
$zone_width = "{$lgsl_config['zone']['width']}px";
$zone_grid = $lgsl_config['grid'][$lgsl_zone_number] ?? 1;
$zone_count = 0;
$output = '';
- $request = empty($lgsl_config['players'][$lgsl_zone_number]) ? "s" : "sp";
+ $request = empty($lgsl_config['players'][$lgsl_zone_number]) ? "s" : "sp";
if ($lgsl_zone_number) {
$server_list = Database::getServersGroup(["request"=>$request, "zone"=>$lgsl_zone_number]);
} else {
@@ -42,10 +44,11 @@