mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
Remove redundant pre-checks from cmdIncCounter and cmdSetCounter so evaluateModifyCounter is the single authorization decision point
This commit is contained in:
parent
3f2bac9b57
commit
0c32e275c5
1 changed files with 0 additions and 14 deletions
|
|
@ -474,13 +474,6 @@ Response::ResponseCode Server_Player::evaluateModifyCounter(bool gameStarted,
|
|||
Response::ResponseCode
|
||||
Server_Player::cmdIncCounter(const Command_IncCounter &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges)
|
||||
{
|
||||
if (!game->getGameStarted()) {
|
||||
return Response::RespGameNotStarted;
|
||||
}
|
||||
if (conceded) {
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
const int counterId = cmd.counter_id();
|
||||
Server_Counter *c = counters.value(counterId, nullptr);
|
||||
|
||||
|
|
@ -537,13 +530,6 @@ Server_Player::cmdCreateCounter(const Command_CreateCounter &cmd, ResponseContai
|
|||
Response::ResponseCode
|
||||
Server_Player::cmdSetCounter(const Command_SetCounter &cmd, ResponseContainer & /*rc*/, GameEventStorage &ges)
|
||||
{
|
||||
if (!game->getGameStarted()) {
|
||||
return Response::RespGameNotStarted;
|
||||
}
|
||||
if (conceded) {
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
const int counterId = cmd.counter_id();
|
||||
Server_Counter *c = counters.value(counterId, nullptr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue