mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
skip public rooms if full. (Should do this in the query....)
This commit is contained in:
parent
ac74cc36a5
commit
1de029f3f0
1 changed files with 10 additions and 4 deletions
|
@ -247,13 +247,19 @@ DBMgr::PublicRooms( int lang, int nPlayers, int* nNames, string& names )
|
|||
|
||||
PGresult* result = PQexec( m_pgconn, query );
|
||||
nTuples = PQntuples( result );
|
||||
int goodCount = 0;
|
||||
for ( ii = 0; ii < nTuples; ++ii ) {
|
||||
names.append( PQgetvalue( result, ii, 0 ) );
|
||||
names.append( "/" );
|
||||
names.append( PQgetvalue( result, ii, 1 ) );
|
||||
int nOpen = atoi( PQgetvalue( result, ii, 1 ) );
|
||||
if ( nOpen > 0 ) {
|
||||
names.append( PQgetvalue( result, ii, 0 ) );
|
||||
names.append( "/" );
|
||||
names.append( PQgetvalue( result, ii, 1 ) );
|
||||
names.append( "\n" );
|
||||
++goodCount;
|
||||
}
|
||||
}
|
||||
PQclear( result );
|
||||
*nNames = nTuples;
|
||||
*nNames = goodCount;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue