Azrael- Posted November 14, 2017 Posted November 14, 2017 Help me on these because it seems that it's not showing the status correctly. All IP/s correctly inserted on Servers.php Status.php <?php if (!defined('FLUX_ROOT')) exit; $cache = FLUX_DATA_DIR.'/tmp/ServerStatus.cache'; if (file_exists($cache) && (time() - filemtime($cache)) < (Flux::config('ServerStatusCache') * 600)) { $serverStatus = unserialize(file_get_contents($cache)); } else { $serverStatus = array(); foreach (Flux::$loginAthenaGroupRegistry as $groupName => $loginAthenaGroup) { if (!array_key_exists($groupName, $serverStatus)) { $serverStatus[$groupName] = array(); } $loginServerUp = $loginAthenaGroup->loginServer->isUp(); foreach ($loginAthenaGroup->athenaServers as $athenaServer) { $serverName = $athenaServer->serverName; $sql = "SELECT COUNT(char_id) AS players_online FROM {$athenaServer->charMapDatabase}.char WHERE online > 0"; $sth = $loginAthenaGroup->connection->getStatement($sql); $sth->execute(); $res = $sth->fetch(); $sqlwoestatus = "SELECT value FROM mapreg WHERE varname = '$\woeStatus' LIMIT 0 , 1"; $sthwoestatus = $loginAthenaGroup->connection->getStatement($sqlwoestatus); $sthwoestatus->execute(); $woestatusresult = $sthwoestatus->fetch(); $serverStatus[$groupName][$serverName] = array( 'loginServerUp' => $loginServerUp, 'charServerUp' => $athenaServer->charServer->isUp(), 'mapServerUp' => $athenaServer->mapServer->isUp(), 'woeStatus' => intval($woestatusresult ? $woestatusresult->value : 0), 'playersOnline' => intval($res ? $res->players_online : 0), ); } } $fp = fopen($cache, 'w'); if (is_resource($fp)) { fwrite($fp, serialize($serverStatus)); fclose($fp); } } $online = "<img src=". $this->themePath('img/serverOnline.png') . " />"; $offline = "<img src=". $this->themePath('img/serverOffline.png') . " />"; $woeOnline = "<img src=". $this->themePath('img/woeOnline.png') . " />"; $woeOffline = "<img src=". $this->themePath('img/woeOffline.png') . " />"; foreach ($serverStatus as $privServerName => $gameServers): foreach ($gameServers as $serverName => $gameServer): if ($gameServer['loginServerUp']) { $loginonline = true; } else { $loginonline = false; } if ($gameServer['charServerUp']) { $charonline = true; } else { $charonline = false; } if ($gameServer['mapServerUp']) { $maponline = true; } else { $maponline = false; } $onlinecount = $gameServer['playersOnline']; $woe_status = $gameServer['woeStatus']; endforeach; endforeach; ?>
0 Azrael- Posted November 14, 2017 Author Posted November 14, 2017 Hi @Cyro, All Ports and IP's on Servers.php are correct. Php Socket Connections is also allowed.
0 rmon Posted November 15, 2017 Posted November 15, 2017 On 11/14/2017 at 3:21 PM, Azrael- said: Hi @Cyro, All Ports and IP's on Servers.php are correct. Php Socket Connections is also allowed. I'm Still looking for a solution on it Add me on Discord
0 BTNX Posted November 15, 2017 Posted November 15, 2017 You have to make sure that your default ports are allowed for outbound
Question
Azrael-
Help me on these because it seems that it's not showing the status correctly. All IP/s correctly inserted on Servers.php
Status.php
4 answers to this question
Recommended Posts