mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
create participant, move code
This commit is contained in:
parent
74bbef53b2
commit
74b5241544
11 changed files with 1084 additions and 669 deletions
|
|
@ -103,14 +103,14 @@ void Server_AbstractUserInterface::joinPersistentGames(ResponseContainer &rc)
|
|||
continue;
|
||||
QMutexLocker gameLocker(&game->gameMutex);
|
||||
|
||||
Server_Player *player = game->getPlayers().value(pr.getPlayerId());
|
||||
if (!player)
|
||||
auto *participant = game->getParticipants().value(pr.getPlayerId());
|
||||
if (!participant)
|
||||
continue;
|
||||
|
||||
player->setUserInterface(this);
|
||||
playerAddedToGame(game->getGameId(), room->getId(), player->getPlayerId());
|
||||
participant->setUserInterface(this);
|
||||
playerAddedToGame(game->getGameId(), room->getId(), participant->getPlayerId());
|
||||
|
||||
game->createGameJoinedEvent(player, rc, true);
|
||||
game->createGameJoinedEvent(participant, rc, true);
|
||||
}
|
||||
server->roomsLock.unlock();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue