Jump to content
  • 0

Get server information (online, woe, players status)


Bacanaman

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  05/28/17
  • Last Seen:  

My website is not hosted in the same host as my server and I need to get some info from the server, such as number of online players, whether the WoE is active or not and server status (online/offline). How can I get that info?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

you just need to configure servers.php , instead of localhost/127.0.0.1 use ip assigned to your box/vps

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

If changing the IP Addresses doesn't work, you have to make sure that PHP Sockets feature is enabled in your web server and the firewall in your VPS accepts outside queries. 

$host = 'your rAthena server IP';
$ports = array(6900,6121,5121,3306);

foreach ($ports as $port)
{
    $connection = @fsockopen($host, $port);

    if (is_resource($connection))
    {
        echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";

        fclose($connection);
    }

    else
    {
        echo '<h2>' . $host . ':' . $port . ' is closed.</h2>' . "\n";
    }
}

if it returns any of the expected response, PHP sockets are enabled. If it retuns that the port is closed then your have to manage your firewall.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  05/28/17
  • Last Seen:  

On 04/06/2017 at 9:34 PM, Ninja said:

If changing the IP Addresses doesn't work, you have to make sure that PHP Sockets feature is enabled in your web server and the firewall in your VPS accepts outside queries. 


$host = 'your rAthena server IP';
$ports = array(6900,6121,5121,3306);

foreach ($ports as $port)
{
    $connection = @fsockopen($host, $port);

    if (is_resource($connection))
    {
        echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";

        fclose($connection);
    }

    else
    {
        echo '<h2>' . $host . ':' . $port . ' is closed.</h2>' . "\n";
    }
}

if it returns any of the expected response, PHP sockets are enabled. If it retuns that the port is closed then your have to manage your firewall.

I use a dedicated server, not a VPS. Thanks for the answer tho, will try using that php script.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

On 6/4/2017 at 1:30 AM, Bacanaman said:

My website is not hosted in the same host as my server

:)

Link to comment
Share on other sites

×
×
  • Create New...