mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
database interface separated from server, multiple concurrent database connections are now possible
This commit is contained in:
parent
2b89c353bf
commit
b328c1ed4d
21 changed files with 347 additions and 310 deletions
|
|
@ -169,7 +169,7 @@ void Server_Room::updateExternalGameList(const ServerInfo_Game &gameInfo)
|
|||
emit roomInfoChanged(getInfo(roomInfo, false, false, true));
|
||||
}
|
||||
|
||||
Response::ResponseCode Server_Room::processJoinGameCommand(const Command_JoinGame &cmd, ResponseContainer &rc, Server_AbstractUserInterface *userInterface, Server_DatabaseInterface *databaseInterface)
|
||||
Response::ResponseCode Server_Room::processJoinGameCommand(const Command_JoinGame &cmd, ResponseContainer &rc, Server_AbstractUserInterface *userInterface)
|
||||
{
|
||||
// This function is called from the Server thread and from the S_PH thread.
|
||||
// server->roomsMutex is always locked.
|
||||
|
|
@ -191,7 +191,7 @@ Response::ResponseCode Server_Room::processJoinGameCommand(const Command_JoinGam
|
|||
|
||||
QMutexLocker gameLocker(&g->gameMutex);
|
||||
|
||||
Response::ResponseCode result = g->checkJoin(databaseInterface, userInterface->getUserInfo(), QString::fromStdString(cmd.password()), cmd.spectator(), cmd.override_restrictions());
|
||||
Response::ResponseCode result = g->checkJoin(userInterface->getUserInfo(), QString::fromStdString(cmd.password()), cmd.spectator(), cmd.override_restrictions());
|
||||
if (result == Response::RespOk)
|
||||
g->addPlayer(userInterface, rc, cmd.spectator());
|
||||
|
||||
|
|
@ -231,7 +231,6 @@ void Server_Room::addGame(Server_Game *game)
|
|||
{
|
||||
// Lock gamesMutex before calling this
|
||||
|
||||
game->moveToThread(thread());
|
||||
connect(game, SIGNAL(gameInfoChanged(ServerInfo_Game)), this, SLOT(broadcastGameListUpdate(ServerInfo_Game)));
|
||||
|
||||
game->gameMutex.lock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue