mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
some minor bug fixes; disallow deck storage commands to unauthenticated users
This commit is contained in:
parent
226837e98a
commit
06de6b1a6c
5 changed files with 23 additions and 3 deletions
|
|
@ -142,6 +142,7 @@ void ProtocolResponse::initializeHash()
|
|||
responseHash.insert("invalid_command", RespInvalidCommand);
|
||||
responseHash.insert("name_not_found", RespNameNotFound);
|
||||
responseHash.insert("login_needed", RespLoginNeeded);
|
||||
responseHash.insert("function_not_allowed", RespFunctionNotAllowed);
|
||||
responseHash.insert("context_error", RespContextError);
|
||||
responseHash.insert("wrong_password", RespWrongPassword);
|
||||
responseHash.insert("spectators_not_allowed", RespSpectatorsNotAllowed);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
class DeckList;
|
||||
|
||||
enum ResponseCode { RespNothing, RespOk, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed };
|
||||
enum ResponseCode { RespNothing, RespOk, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespFunctionNotAllowed, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed };
|
||||
|
||||
// PrivateZone: Contents of the zone are always visible to the owner,
|
||||
// but not to anyone else.
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ void Server_Game::stopGameIfFinished()
|
|||
Server_Player *player = playerIterator.next().value();
|
||||
player->sendProtocolItem(new Event_GameStateChanged(gameId, gameStarted, -1, -1, getGameState(player)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ResponseCode Server_Game::checkJoin(const QString &_password, bool spectator)
|
||||
|
|
@ -185,6 +184,8 @@ void Server_Game::removePlayer(Server_Player *player)
|
|||
|
||||
if (!getPlayerCount())
|
||||
deleteLater();
|
||||
else
|
||||
stopGameIfFinished();
|
||||
qobject_cast<Server *>(parent())->broadcastGameListUpdate(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue