Page 1 of 1

Write a message when the server is off

Posted: 15 Jul 2017, 21:27
by Lugurbal
Hello,

I would write a message on my website when my server is off but at every time, i get a error :

Code: Select all

Fatal error: Uncaught Maniaplanet\DedicatedServer\Xmlrpc\TransportException: Cannot open socket in /home/lyreclan/www/vendor/maniaplanet/dedicated-server-api/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php:80 Stack trace: #0 /home/lyreclan/www/vendor/maniaplanet/dedicated-server-api/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php(34): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->connect('127.0.0.1', '5001', '5') #1 /home/lyreclan/www/vendor/maniaplanet/dedicated-server-api/libraries/Maniaplanet/DedicatedServer/Connection.php(103): Maniaplanet\DedicatedServer\Xmlrpc\GbxRemote->__construct('127.0.0.1', '5001', '5') #2 /home/lyreclan/www/vendor/maniaplanet/dedicated-server-api/libraries/Maniaplanet/DedicatedServer/Connection.php(51): Maniaplanet\DedicatedServer\Connection->__construct('127.0.0.1', '5001', '5') #3 /home/lyreclan/www/admin/adminservtm.php(15): Maniaplanet\DedicatedServer\Connection::factory('127.0.0.1', '5001', '5', 'SuperAdmin', 'TestServ', '2013-04-16') #4 {main} thrown in /home/lyreclan/www/vendor/maniaplanet/dedicated-server-api/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php on line 80
Can you help me ?

Re: Write a message when the server is off

Posted: 16 Jul 2017, 07:31
by steeffeen
well doesn't this error pretty much indicate that the server isn't running? so you could display the message on your website if this exception occurs
(I'm not sure if this is actually the case)

Code: Select all

try {
    $connection = Connection::factory();
} catch (TransportException $transportException) {
    echo "Server is offline";
}