$serverStatus = new ServerStatus(); foreach ($servers as $server) { $parts = explode(':', $server->ip); if (count($parts) == 1) { $server_ip = htmlspecialchars($parts[0]); $server_port = 25565; } else { if (count($parts) == 2) { $server_ip = htmlspecialchars($parts[0]); $server_port = htmlspecialchars($parts[1]); } else { echo 'Invalid IP</div>'; die; } } if ($serverStatus->isOnline($server_ip, $server_port, $mcname) === true) { $is_online = $server->name; break; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="User profile page • <?php echo $sitename;
// we don't want to count AJAX scripts/guild images as page views, we also don't need status if (!ONLY_PAGE) { // STATUS CHECKER $statustimeout = 1; foreach (explode("*", str_replace(" ", "", $config['server']['statustimeout'])) as $status_var) { if ($status_var > 0) { $statustimeout = $statustimeout * $status_var; } } $statustimeout = $statustimeout / 1000; $config['status'] = parse_ini_file('cache/DONT_EDIT_serverstatus.txt'); if ($config['status']['serverStatus_lastCheck'] + $statustimeout < time()) { $config['status']['serverStatus_checkInterval'] = $statustimeout + 3; $config['status']['serverStatus_lastCheck'] = time(); $statusInfo = new ServerStatus('127.0.0.1', $config['server']['status_port'], 1); if ($statusInfo->isOnline()) { $config['status']['serverStatus_online'] = 1; $config['status']['serverStatus_players'] = $statusInfo->getPlayersCount(); $config['status']['serverStatus_playersMax'] = $statusInfo->getPlayersMaxCount(); $h = floor($statusInfo->getUptime() / 3600); $m = floor(($statusInfo->getUptime() - $h * 3600) / 60); $config['status']['serverStatus_uptime'] = $h . 'h ' . $m . 'm'; $config['status']['serverStatus_monsters'] = $statusInfo->getMonsters(); } else { $config['status']['serverStatus_online'] = 0; $config['status']['serverStatus_players'] = 0; $config['status']['serverStatus_playersMax'] = 0; } $file = fopen("cache/DONT_EDIT_serverstatus.txt", "w"); $file_data = ''; foreach ($config['status'] as $param => $data) {