preliminary showGamesOfUser support

This commit is contained in:
Max-Wilhelm Bruker 2011-07-02 14:36:10 +02:00
parent 0120d2a019
commit be12a0b3a9
15 changed files with 183 additions and 91 deletions

View file

@ -130,3 +130,17 @@ int Server_Room::getGamesCreatedByUser(const QString &userName) const
++result;
return result;
}
QList<ServerInfo_Game *> Server_Room::getGamesOfUser(const QString &userName) const
{
QMutexLocker locker(&roomMutex);
QList<ServerInfo_Game *> result;
QMapIterator<int, Server_Game *> gamesIterator(games);
while (gamesIterator.hasNext()) {
Server_Game *game = gamesIterator.next().value();
if (game->containsUser(userName))
result.append(game->getInfo());
}
return result;
}