mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
changed leave game shortcut, server cleanups, added max_games_per_user
This commit is contained in:
parent
d0b8c6ebd9
commit
38b31681e2
11 changed files with 85 additions and 64 deletions
|
|
@ -44,6 +44,7 @@ Server_Game::Server_Game(Server_ProtocolHandler *_creator, int _gameId, const QS
|
|||
|
||||
Server_Game::~Server_Game()
|
||||
{
|
||||
QMutexLocker roomLocker(&room->roomMutex);
|
||||
QMutexLocker locker(&gameMutex);
|
||||
|
||||
sendGameEvent(new Event_GameClosed);
|
||||
|
|
@ -53,7 +54,7 @@ Server_Game::~Server_Game()
|
|||
delete playerIterator.next().value();
|
||||
players.clear();
|
||||
|
||||
emit gameClosing();
|
||||
room->removeGame(this);
|
||||
delete creatorInfo;
|
||||
qDebug("Server_Game destructor");
|
||||
}
|
||||
|
|
@ -233,6 +234,7 @@ Server_Player *Server_Game::addPlayer(Server_ProtocolHandler *handler, bool spec
|
|||
|
||||
void Server_Game::removePlayer(Server_Player *player)
|
||||
{
|
||||
QMutexLocker roomLocker(&room->roomMutex);
|
||||
QMutexLocker locker(&gameMutex);
|
||||
|
||||
players.remove(player->getPlayerId());
|
||||
|
|
@ -281,6 +283,7 @@ void Server_Game::removeArrowsToPlayer(Server_Player *player)
|
|||
|
||||
bool Server_Game::kickPlayer(int playerId)
|
||||
{
|
||||
QMutexLocker roomLocker(&room->roomMutex);
|
||||
QMutexLocker locker(&gameMutex);
|
||||
|
||||
Server_Player *playerToKick = players.value(playerId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue