mutex fixes, server shutdown works again

This commit is contained in:
Max-Wilhelm Bruker 2012-03-17 19:05:22 +01:00
parent d792c3ddc6
commit 671214c60e
9 changed files with 34 additions and 27 deletions

View file

@ -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;