'', '~1' => '', '~2' => '', '~3' => '', '~4' => '', '~5' => '', '~6' => '', '~7' => '', '~8' => '', '~9' => '', ); $str = str_replace(array_keys($arr), array_values($arr), $str); return $str . str_repeat("", substr_count($str, "= 3600) { return sprintf('%02d:%02d:%02d', ($Seconds / 3600), ($Seconds / 60 % 60), $Seconds % 60); } return sprintf('%02d:%02d', ($Seconds / 60 % 60), $Seconds % 60); } // Include database configuration require("../php/lobby.php"); // Connect to database $Db = new mysqli($MySql_Host, $MySql_User, $MySql_Pass, $MySql_Db); if ($Db->connect_errno) { die("

Database connection failed: " . $Db->connect_error . "

"); } // Query to fetch server information $sql = "SELECT Name, GameType, MissionName, IPAddress, Port, CurrentPlayers, MaxPlayers, TimeRemaining, Hz64 FROM dll_status"; $result = $Db->query($sql); if (!$result) { die("

Query failed: " . $Db->error . "

"); } // Prepare server data $servers = []; while ($row = $result->fetch_assoc()) { $servers[] = [ 'name' => StringFormatter::colorTilde($row['Name']), 'gameType' => $row['GameType'], 'map' => $row['MissionName'], 'ip_port' => $row['IPAddress'] . ':' . $row['Port'], 'players' => intval($row['CurrentPlayers']) . '/' . intval($row['MaxPlayers']), 'time_left' => GameTimeToString($row['TimeRemaining']), 'hz64' => $row['Hz64'] === 'Yes' ? '64Hz' : 'No' ]; } // Close the database connection $Db->close(); ?> Server Status
Server Type Map IP:Port Players Time Left 64Hz
No servers found.