<?php
$serverIsOn = 0;
$serverAddress = "127.0.0.1"; // Change this variable with your server IP
$MySQLPort = 3306; // Change this with your MySQL Port. The default is: 3306
$loginServerPort = 23000; // Change this with your LoginServer Port
$charServerPort = 28000; // Change this with your CharServer Port
$worldServerPort = 15400; // Change this with your WorldServer Port
if(@fsockopen($serverAddress, $MySQLPort, $errno, $errstr, 1)) {
$serverIsOn++;
}
if(@fsockopen($serverAddress, $loginServerPort, $errno, $errstr, 1)) {
$serverIsOn++;
}
if(@fsockopen($serverAddress, $charServerPort, $errno, $errstr, 1)) {
$serverIsOn++;
}
if(@fsockopen($serverAddress, $worldServerPort, $errno, $errstr, 1)) {
$serverIsOn++;
}
if($serverIsOn >= 4) {
echo "Server is: <font color=green><b>Online</b></font>";
} else {
echo "Server is: <font color=red><b>Offline</b></font>";
}
?>