- sort servers with games not started and open slots to the top

This commit is contained in:
Mark Vejvoda 2011-01-25 20:06:06 +00:00
parent fbdd3a0a8f
commit 9c842f1688
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
// consider replacing this by a cron job
cleanupServerList( MYSQL_DATABASE );
$servers_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestserver ORDER BY lasttime DESC;' );
$servers_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestserver ORDER BY status, (networkSlots - connectedClients) DESC, lasttime DESC;' );
$all_servers = array();
while ( $server = mysql_fetch_array( $servers_in_db ) )
{

View File

@ -8,7 +8,7 @@
// consider replacing this by a cron job
cleanupServerList( MYSQL_DATABASE );
$servers_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestserver ORDER BY lasttime DESC;' );
$servers_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestserver ORDER BY status, (networkSlots - connectedClients) DESC, lasttime DESC;' );
$all_servers = array();
while ( $server = mysql_fetch_array( $servers_in_db ) )
{