mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 06:22:15 -07:00
fix regressions
This commit is contained in:
parent
14ee73c85a
commit
270b957618
3 changed files with 6 additions and 5 deletions
|
|
@ -605,7 +605,8 @@ void Server_AbstractParticipant::setUserInterface(Server_AbstractUserInterface *
|
||||||
|
|
||||||
void Server_AbstractParticipant::disconnectClient()
|
void Server_AbstractParticipant::disconnectClient()
|
||||||
{
|
{
|
||||||
if (!(userInfo->user_level() & ServerInfo_User::IsRegistered) || spectator) {
|
bool IsRegistered = userInfo->user_level() & ServerInfo_User::IsRegistered;
|
||||||
|
if (!IsRegistered || spectator) {
|
||||||
game->removeParticipant(this, Event_Leave::USER_DISCONNECTED);
|
game->removeParticipant(this, Event_Leave::USER_DISCONNECTED);
|
||||||
} else {
|
} else {
|
||||||
setUserInterface(nullptr);
|
setUserInterface(nullptr);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ protected:
|
||||||
int playerId;
|
int playerId;
|
||||||
bool spectator;
|
bool spectator;
|
||||||
bool judge;
|
bool judge;
|
||||||
void getPlayerProperties(ServerInfo_PlayerProperties &result);
|
virtual void getPlayerProperties(ServerInfo_PlayerProperties &result);
|
||||||
mutable QMutex playerMutex;
|
mutable QMutex playerMutex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -73,14 +73,14 @@ void Server_ProtocolHandler::prepareDestroy()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
game->gameMutex.lock();
|
game->gameMutex.lock();
|
||||||
Server_Player *p = game->getPlayer(gameIterator.value().second);
|
auto *participant = game->getParticipants().value(gameIterator.value().second);
|
||||||
if (!p) {
|
if (!participant) {
|
||||||
game->gameMutex.unlock();
|
game->gameMutex.unlock();
|
||||||
room->gamesLock.unlock();
|
room->gamesLock.unlock();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->disconnectClient();
|
participant->disconnectClient();
|
||||||
|
|
||||||
game->gameMutex.unlock();
|
game->gameMutex.unlock();
|
||||||
room->gamesLock.unlock();
|
room->gamesLock.unlock();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue