Jump to content
  • 0

Get server information (online, woe, players status)


Question

Posted

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?

4 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...