3 OR (status = 3 AND a.lasttime > DATE_add(NOW(), INTERVAL - ' . MAX_HOURS_OLD_GAMES . ' hour)) ORDER BY status, a.lasttime DESC, connectedClients > 0 DESC, (networkSlots - connectedClients) , ip DESC;' ); $all_servers = array(); while ( $server = mysql_fetch_array( $servers_in_db ) ) { array_push( $all_servers, $server ); } unset( $servers_in_db ); unset( $server ); db_disconnect( DB_LINK ); unset( $linkid ); // Representation starts here header( 'Content-Type: text/html; charset=utf-8' ); if ( REFRESH_INTERVAL != 0 ) { if ( REFRESH_INTERVAL <= 10 ) { header( 'Refresh: 10' ); } else { header( 'Refresh: ' . REFRESH_INTERVAL ); } } echo '' . PHP_EOL; echo '' . PHP_EOL; echo '
' . PHP_EOL; echo ' ' . PHP_EOL; echo 'Version | ' . PHP_EOL; echo 'Status | ' . PHP_EOL; echo 'Game Duration | ' . PHP_EOL; echo 'Country | ' . PHP_EOL; echo 'Title | ' . PHP_EOL; echo 'Techtree | ' . PHP_EOL; echo 'Network players | ' . PHP_EOL; echo 'Network slots | ' . PHP_EOL; echo 'Total slots | ' . PHP_EOL; echo 'Map | ' . PHP_EOL; echo 'Tileset | ' . PHP_EOL; echo 'IPv4 address | ' . PHP_EOL; echo 'Game protocol port | ' . PHP_EOL; echo 'Platform | ' . PHP_EOL; echo 'Build date | ' . PHP_EOL; echo '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
%s | %s", htmlspecialchars( $server['glestVersion'], ENT_QUOTES ), htmlspecialchars( $server['glestVersion'], ENT_QUOTES ), PHP_EOL ); // status $status_code = $server['status']; if ( $status_code == 0) { $gameFull = ( $server['networkSlots'] <= $server['connectedClients'] ); if ( $gameFull == true ) { $status_code = 1; } } switch ( $status_code ) { case 0: $status_title = 'waiting for players'; $status_class = 'waiting_for_players'; break; case 1: $status_title = 'game full, pending start'; $status_class = 'game_full_pending_start'; break; case 2: $status_title = 'in progress'; $status_class = 'in_progress'; break; case 3: $status_title = 'finished'; $status_class = 'finished'; break; default: $status_title = 'unknown'; $status_class = 'unknown'; } if (($status_code == 2 || $status_code == 3) && $server['gameUUID'] != "") { $games_with_stats++; printf( "\t\t\t\t%s", $server['status'], $status_class, $games_with_stats, $server['gameUUID'], htmlspecialchars( $status_title, ENT_QUOTES ) ); printf( " | %s", PHP_EOL ); } else { printf( "\t\t\t\t%s | %s", $server['status'], $status_class, htmlspecialchars( $status_title, ENT_QUOTES ), PHP_EOL ); } // Game Stats $gameDuration = $server['framesToCalculatePlaytime']; $gameDuration = getTimeString($gameDuration); printf( "\t\t\t\t%s | %s", htmlspecialchars( $gameDuration, ENT_QUOTES ), PHP_EOL ); // country if ( $server['country'] !== '' ) { $flagfile = 'flags/' . strtolower( $server['country'] ).'.png'; if ( file_exists( $flagfile ) ) { printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['country'], ENT_QUOTES ), PHP_EOL ); } } else { printf( "\t\t\t\tunknown | %s", PHP_EOL ); } // serverTitle printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['serverTitle'], ENT_QUOTES ), PHP_EOL ); // tech printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['tech'], ENT_QUOTES ), PHP_EOL ); // connectedClients printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['connectedClients'], ENT_QUOTES ), PHP_EOL ); // networkSlots printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['networkSlots'], ENT_QUOTES ), PHP_EOL ); // activeSlots printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['activeSlots'], ENT_QUOTES ), PHP_EOL ); // map printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['map'], ENT_QUOTES ), PHP_EOL ); // tileset printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['tileset'], ENT_QUOTES ), PHP_EOL ); // ip printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['ip'], ENT_QUOTES ), PHP_EOL ); // externalServerPort printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['externalServerPort'], ENT_QUOTES ), PHP_EOL ); // platform printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['platform'], ENT_QUOTES ), PHP_EOL ); // binaryCompileDate printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['binaryCompileDate'], ENT_QUOTES ), PHP_EOL ); echo "\t\t\t" . '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%s", PHP_EOL ); echo "\t\t\t" . ' |
' . PHP_EOL;
echo '
' . PHP_EOL;
echo '
Filters active:
" . PHP_EOL; echo "\t\tUsage:
' . PHP_EOL; echo '?refresh=60
to the URL. Minimum refresh time is 10 seconds.