' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['glestVersion'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['platform'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['binaryCompileDate'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['serverTitle'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['ip'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['tech'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['map'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['tileset'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['activeSlots'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['networkSlots'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['connectedClients'], ENT_QUOTES ) . ' | ' . PHP_EOL;
echo "\t\t\t\t" . htmlspecialchars( $server['externalServerPort'], ENT_QUOTES ) . ' | ' . PHP_EOL;
if ( $server['country'] !== '' ) {
$flagfile = 'flags/' . strtolower( $server['country'] ).'.png';
if ( file_exists( $flagfile ) ) {
echo "\t\t\t\t" . '' . ' | ' . PHP_EOL;
} else {
echo "\t\t\t\t" . 'unknown' . ' | ' . PHP_EOL;
}
}
else {
echo "\t\t\t\t" . htmlspecialchars( $server['country'], ENT_QUOTES ) . ' | ' . PHP_EOL;
}
$calculatedStatus = $server['status'];
if($calculatedStatus == 0)
{
$gameFull = ($server['networkSlots'] <= $server['connectedClients']);
if($gameFull == true)
{
$calculatedStatus = 1;
}
}
switch($calculatedStatus)
{
case 0:
echo "\t\t\t\t" . htmlspecialchars( "waiting for players", ENT_QUOTES ) . ' | ' . PHP_EOL;
break;
case 1:
echo "\t\t\t\t" . htmlspecialchars( "game full, pending start", ENT_QUOTES ) . ' | ' . PHP_EOL;
break;
case 2:
echo "\t\t\t\t" . htmlspecialchars( "in progress", ENT_QUOTES ) . ' | ' . PHP_EOL;
break;
case 3:
echo "\t\t\t\t" . htmlspecialchars( "finished", ENT_QUOTES ) . ' | ' . PHP_EOL;
break;
default:
echo "\t\t\t\t" . htmlspecialchars( "unknown: " . $server['status'], ENT_QUOTES ) . ' | ' . PHP_EOL;
}
echo "\t\t\t" . '
' . PHP_EOL;
}
unset( $all_servers );
unset( $server );
echo <<