Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tltneon committed Dec 27, 2024
1 parent 2dc84ee commit 35fae92
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/languages/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/lgsl_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}')"];

Expand Down
12 changes: 7 additions & 5 deletions src/lgsl_protocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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}";
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/classic_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 2 additions & 0 deletions userbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
Expand Down

0 comments on commit 35fae92

Please sign in to comment.