mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
mutex fixes, server shutdown works again
This commit is contained in:
parent
d792c3ddc6
commit
671214c60e
9 changed files with 34 additions and 27 deletions
|
|
@ -307,6 +307,12 @@ void Server_Game::stopGameIfFinished()
|
|||
|
||||
Response::ResponseCode Server_Game::checkJoin(ServerInfo_User *user, const QString &_password, bool spectator, bool overrideRestrictions)
|
||||
{
|
||||
{
|
||||
QMapIterator<int, Server_Player *> playerIterator(players);
|
||||
while (playerIterator.hasNext())
|
||||
if (playerIterator.next().value()->getUserInfo()->name() == user->name())
|
||||
return Response::RespContextError;
|
||||
}
|
||||
if (!(overrideRestrictions && (user->user_level() & ServerInfo_User::IsModerator))) {
|
||||
if ((_password != password) && !(spectator && !spectatorsNeedPassword))
|
||||
return Response::RespWrongPassword;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue