|
@@ -949,10 +949,10 @@ Result ISDatenbank::getSpielerListe( char *suche, int *seite, int *maxSeite, int
|
|
|
Text *befehl = new Text( "SELECT count( a.id ) FROM account a, "
|
|
|
"( SELECT a.id, max( b.datum ) "
|
|
|
" FROM account a LEFT JOIN "
|
|
|
- " ( SELECT g.spiel_art_id, i.account_id, max( h.beginn_datum ) "
|
|
|
+ " ( SELECT g.spiel_art_id, i.account_id"
|
|
|
" FROM karte g, spiel h, spiel_spieler i "
|
|
|
- " WHERE i.spiel_id = h.id AND h.karte_id = g.id "
|
|
|
- " GROUP BY g.spiel_art_id, i.account_id ) f ON a.id = f.account_id "
|
|
|
+ " WHERE i.spiel_id = h.id AND h.karte_id = g.id AND h.beginn_datum = "
|
|
|
+ " ( SELECT max( x.beginn_datum ) FROM spiel x, spiel_spieler y WHERE y.spiel_id = x.id AND y.account_id = i.account_id ) "
|
|
|
" LEFT JOIN account_online b ON b.account_id = a.id "
|
|
|
" LEFT JOIN spiel_statistik e ON e.account_id = a.id "
|
|
|
" LEFT JOIN spiel_art c ON c.id = f.spiel_art_id "
|
|
@@ -995,10 +995,10 @@ Result ISDatenbank::getSpielerListe( char *suche, int *seite, int *maxSeite, int
|
|
|
}
|
|
|
befehl->setText( "SELECT a.id, a.ruf_name, max( b.datum ), c.name, d.name, e.punkte "
|
|
|
"FROM account a LEFT JOIN "
|
|
|
- "( SELECT g.spiel_art_id, i.account_id, max( h.beginn_datum ) "
|
|
|
+ "( SELECT g.spiel_art_id, i.account_id "
|
|
|
" FROM karte g, spiel h, spiel_spieler i "
|
|
|
- " WHERE i.spiel_id = h.id AND h.karte_id = g.id "
|
|
|
- " GROUP BY g.spiel_art_id, i.account_id ) f ON a.id = f.account_id "
|
|
|
+ " WHERE i.spiel_id = h.id AND h.karte_id = g.id AND h.beginn_datum = "
|
|
|
+ "( SELECT max( x.beginn_datum ) FROM spiel x, spiel_spieler y WHERE y.spiel_id = x.id AND y.account_id = i.account_id ) "
|
|
|
"LEFT JOIN account_online b ON b.account_id = a.id "
|
|
|
"LEFT JOIN spiel_statistik e ON e.account_id = a.id "
|
|
|
"LEFT JOIN spiel_art c ON c.id = f.spiel_art_id "
|
|
@@ -1770,7 +1770,7 @@ bool ISDatenbank::getHistorieServerPortIp( int clientId, int spielId, int *port,
|
|
|
{
|
|
|
lock();
|
|
|
if( !datenbank->befehl( Text( "SELECT a.id, a.port, a.ip FROM server a, server_historie_spiel b "
|
|
|
- "WHERE a.id = b.server_historie_id AND a.clients < a.max_clients - 1 AND "
|
|
|
+ "WHERE a.id = b.server_historie_id AND a.tasks < a.max_tasks - 1 AND "
|
|
|
"a.server_status_id = 3 AND b.spiel_id = " ) += spielId ) )
|
|
|
{
|
|
|
unlock();
|