mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
preliminary showGamesOfUser support
This commit is contained in:
parent
0120d2a019
commit
be12a0b3a9
15 changed files with 183 additions and 91 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue