Azrael- Posted November 14, 2017 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 23 Reputation: 3 Joined: 11/14/17 Last Seen: June 4, 2018 Share 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; ?> Link to comment Share on other sites More sharing options...
0 Cyro Posted November 14, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 1138 Reputation: 290 Joined: 04/29/13 Last Seen: July 20, 2024 Share Posted November 14, 2017 Similar thread Link to comment Share on other sites More sharing options...
0 Azrael- Posted November 14, 2017 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 23 Reputation: 3 Joined: 11/14/17 Last Seen: June 4, 2018 Author Share Posted November 14, 2017 Hi @Cyro, All Ports and IP's on Servers.php are correct. Php Socket Connections is also allowed. Link to comment Share on other sites More sharing options...
0 rmon Posted November 15, 2017 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 97 Reputation: 2 Joined: 04/27/16 Last Seen: Tuesday at 08:05 AM Share 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 Link to comment Share on other sites More sharing options...
0 BTNX Posted November 15, 2017 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 55 Reputation: 3 Joined: 04/02/12 Last Seen: October 22, 2022 Share Posted November 15, 2017 You have to make sure that your default ports are allowed for outbound Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
4 answers to this question
Recommended Posts