فهرست منبع

Account suche Fehler behoben der doppelte Einträge verursacht hat

Kolja Strohm 7 سال پیش
والد
کامیت
9c5c64f54f

+ 7 - 7
InformationServer/Datenbank.cpp

@@ -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();

+ 1 - 1
InformationServer/InformationServer.cpp

@@ -701,7 +701,7 @@ void ISKlient::thread()
 					klient->sendeEncrypted( "\1", 1 );
 					char typ = 0;
 					Text *info = is->zDB()->getInformationsText( &typ );
-					unsigned short len = info ? (unsigned short)info->getLength() : 0;
+					unsigned short len = info ? (unsigned short)info->getLength() : (unsigned short)0;
 					klient->sendeEncrypted( (char*)&len, 2 );
 					if( len > 0 )
 						klient->sendeEncrypted( info->getText(), len );

+ 1 - 0
InformationServer/InformationServer.vcxproj

@@ -39,6 +39,7 @@
     <IncludePath>..\..\..\..\Allgemein\Framework;../../../Framework/release;..\..\..\..\Allgemein\Network\Network;../../../Network/release;..\..\..\..\Allgemein\sql\sql;../../../sql/release;$(IncludePath)</IncludePath>
     <OutDir>$(ProjectDir)bin\$(Platform)\release\</OutDir>
     <IntDir>$(ProjectDir)obj\$(Platform)\release\</IntDir>
+    <TargetExt />
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <RemoteProjectDir>$(RemoteRootDir)/Server/$(ProjectName)/debug</RemoteProjectDir>

+ 1 - 1
InformationServer/main.cpp

@@ -7,7 +7,7 @@
 int main()
 {
 #ifdef DEBUG
-    cd( "/test/information" );
+    //cd( "/test/information" );
 #endif
     Framework::initFramework();
 	Zeit *z = getZeit();