From 35fae921eb5c2ecd293c3883267c6c2a6b4e440e Mon Sep 17 00:00:00 2001 From: Neon Date: Fri, 27 Dec 2024 22:10:06 +0700 Subject: [PATCH] Small fixes --- install.php | 1 + src/languages/english.php | 2 ++ src/lgsl_class.php | 1 + src/lgsl_protocol.php | 12 +++++++----- src/styles/classic_style.css | 1 + userbar.php | 2 ++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/install.php b/install.php index e966239..0f0c941 100644 --- a/install.php +++ b/install.php @@ -223,6 +223,7 @@ function type($var) { \$lgsl_config['cms'] = 'sa'; // sets which CMS specific code to use \$lgsl_config['disabled_types']= false; // allow to exclude some protocols (games) from list. usage: ['disabled_types']= ['halflifewon', 'test']; \$lgsl_config['select_lang'] = {$conf['select_lang']}; // allow to select language for users + \$lgsl_config['remove_colors'] = true; // remove colors from the server name \$lgsl_config['language'] = '{$conf['language']}'; // sets LGSL language include('languages/{$conf['language']}.php'); // loads LGSL language class Config implements \ArrayAccess { diff --git a/src/languages/english.php b/src/languages/english.php index 541de1e..f047f6e 100644 --- a/src/languages/english.php +++ b/src/languages/english.php @@ -61,6 +61,8 @@ $lgsl_config['text']['kil'] = "Kills"; $lgsl_config['text']['squ'] = "Squad"; $lgsl_config['text']['ski'] = "Skill"; + $lgsl_config['text']['mes'] = "Mesh"; + $lgsl_config['text']['fac'] = "Face"; $lgsl_config['text']['xp'] = "XP"; $lgsl_config['text']['key'] = "Key"; $lgsl_config['text']['spe'] = "Spectator"; diff --git a/src/lgsl_class.php b/src/lgsl_class.php index 15ba19d..e4d7696 100644 --- a/src/lgsl_class.php +++ b/src/lgsl_class.php @@ -913,6 +913,7 @@ public function getConnectionLink() { Protocol::TEASPEAK => "ts3server://{IP}?port={C_PORT}", Protocol::URBANTERROR => "urt://{IP}:{S_PORT}", Protocol::UNVANQUISHED => "unv://{IP}:{C_PORT}", + Protocol::UT => "unreal://{IP}:{C_PORT}", Protocol::WARSOW => "warsow://{IP}:{C_PORT}", Protocol::WOW => "javascript:prompt('Put it into your realm list:', 'set realmlist {IP}')"]; diff --git a/src/lgsl_protocol.php b/src/lgsl_protocol.php index fd537d6..3fd0628 100644 --- a/src/lgsl_protocol.php +++ b/src/lgsl_protocol.php @@ -322,7 +322,7 @@ static public function lgslList($type = null) { self::WARSOW => ["Query02", "Warsow"], self::UNVANQUISHED => ["Query02", "Unvanquished"], self::URBANTERROR => ["Query02", "UrbanTerror"], - self::UT => ["Query03", "Unreal Tournament"], + self::UT => ["Query03", "Unreal Tournament 99"], self::UT2003 => ["Query13", "Unreal Tournament 2003"], self::UT2004 => ["Query13", "Unreal Tournament 2004"], self::UT3 => ["Query11", "Unreal Tournament 3"], @@ -2428,10 +2428,11 @@ public function process() { if ($this->need('p')) { $buffer = $this->fetch("http://{$this->_server->getIp()}:{$this->_server->getQueryPort()}/players.json"); - - foreach($buffer as $key => $value) { - $this->_data['p'][$key]['name'] = $value['name']; - $this->_data['p'][$key]['ping'] = $value['ping']; + if ($buffer) { + foreach ($buffer as $key => $value) { + $this->_data['p'][$key]['name'] = $value['name']; + $this->_data['p'][$key]['ping'] = $value['ping']; + } } } return $this::SUCCESS; @@ -3164,6 +3165,7 @@ public function readRaw($length = 4096) { if ($this->_isHttp()) { $result = curl_exec($this->_stream); $resultStatus = curl_getinfo($this->_stream, CURLINFO_HTTP_CODE); + $err = ""; if ($resultStatus != 200) { $err = "Request failed: HTTP status code {$resultStatus}"; } diff --git a/src/styles/classic_style.css b/src/styles/classic_style.css index ed0d921..59d0275 100644 --- a/src/styles/classic_style.css +++ b/src/styles/classic_style.css @@ -29,6 +29,7 @@ a:active { color:#7500c0; } .annotation { text-align: center; background-color: #e4eaf2; padding-top:17px; padding-bottom:17px; } /* details */ +summary { cursor: pointer; } .players_table { margin: auto; border-spacing: 2px 4px; } .settings_table { margin: auto; border-spacing: 2px 4px; max-width: 600px; } .players_table tr, .settings_table tr { white-space:nowrap; table-layout:fixed; } diff --git a/userbar.php b/userbar.php index 8e75e55..7592156 100644 --- a/userbar.php +++ b/userbar.php @@ -84,6 +84,7 @@ function drawHistory(&$im, $x, $y, $w, $h, &$server) { $time = date(str_replace([':S', ':s', '/Y', '/y'], '', $lgsl_config['text']['tzn'])); switch ($server->getStatus()) { + case Server::ERROR: case Server::ONLINE: { $stat = $stat_on; break; } case Server::OFFLINE: { $stat = $stat_of; break; } case Server::PENDING: { $stat = $stat_pn; break; } @@ -126,6 +127,7 @@ function drawHistory(&$im, $x, $y, $w, $h, &$server) { $time = date(str_replace([':S', ':s', '/Y', '/y'], '', $lgsl_config['text']['tzn'])); switch ($server->getStatus()) { + case Server::ERROR: case Server::ONLINE: { $stat = $stat_on; break; } case Server::OFFLINE: { $stat = $stat_of; break; } case Server::PENDING: { $stat = $stat_pn; break; }