From 0c32e275c5122f917d178581e15f5b8348f4552b Mon Sep 17 00:00:00 2001 From: DawnFire42 Date: Fri, 7 Aug 2026 18:55:03 -0400 Subject: [PATCH] Remove redundant pre-checks from cmdIncCounter and cmdSetCounter so evaluateModifyCounter is the single authorization decision point --- .../network/server/remote/game/server_player.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp index 219582c15..9622bd0bb 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_player.cpp @@ -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);