create participant, move code

This commit is contained in:
ebbit1q 2025-09-18 12:02:09 +02:00
parent dc3d40d261
commit cf6826dc00
11 changed files with 1084 additions and 669 deletions

View file

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