feat: implement cannot_restart turn reset lockout system - #380
Conversation
Introduces a centralized `cannot_restart` flag managed via `PlayerHelper` to replace the deprecated `has_explored` attribute. This establishes structural groundwork to prevent turn rollbacks whenever a player exposes hidden gamestate information. Changes include: - `helpers/PlayerHelper.py`: Added `cannotRestart()` getter and `setCannotRestart()` setter methods to safely handle the new state attribute. - `Buttons/Turn.py`: Integrated `cannotRestart()` check into `restartTurn` to block resets, and ensured the flag resets to `False` inside `endTurn` when the player completes their turn. - `Buttons/Explore.py`: Set the `cannot_restart` flag to `True` upon resolving an explicit exploration choice. - `Buttons/Research.py`: Restricted turn restarts when a player draws discovery tiles via standard research items or triggers the Magellan 4th technology milestone. - `commands/player_commands.py`: Added a `/player set_cannot_restart` admin Discord command for manual troubleshooting/overrides.
|
Allowing restarts should be the default option. If the table decides they want to play extra strict then they can run a command to turn this feature on. Though all of it seems somewhat moot considering you can still just undo your turn. If the goal is to prevent cheating, undo is still available and there are many ways to cheat. If we're not worried about cheaters with this feature then we are just punishing misclicks/mistakes/new players by forbidding restarts |
|
@TaylorBoyd The idea is make it easy for a group of players have rule guard rails. This feature puts guard rails on the following conditions:
Additionally, this feature lets a group or a player recover from a mistake; if they truly want to restart just use command |
🟢 The Pros Exposes the "Security Theater" (The Undo Loophole): The commenter points out a major logical flaw: if players can still just use a manual undo command to bypass the lockout, this new feature doesn't actually stop a committed cheater. It creates a false sense of security while only adding friction for honest players. Promotes Table Autonomy (Opt-in Strictness): By suggesting this be an opt-in toggle rather than a forced, global restriction, it allows casual groups to stay relaxed while letting highly competitive groups turn on "tournament mode" via a configuration command if they choose. 🔴 The Cons Puts the Enforcement Burden on the Host: If the strict anti-cheat feature is turned off by default, the game host or server administrator has to remember to run a manual configuration command before every single match. Important rules are usually safer when they are "secure by default." The "Perfect Solution" Fallacy: Just because an undo command exists doesn't mean the developers shouldn't try to lock down smaller, accidental exploits. Preventing an easy turn-restart exploit inside the active UI buttons is still a valuable, incremental step toward game state integrity, even if a broader undo override command still exists in the background. |


Title
feat: Migrate turn reset lockout system to PlayerHelper methodsDescription
A new property
cannot_restartis added to the player's data model. Whenever an action is taken that reveals hidden or confidential gamestate information—such as making explicit exploration choices or pulling discovery tiles via research milestones—the turn is permanently locked for that round to preserve integrity and prevent unfair rollbacks.Key Changes
🛠️ Core Player Model & Helpers
helpers/PlayerHelper.pycannotRestart()getter to safely verify if a player is restricted from resetting.setCannotRestart(bool)setter to manipulate the underlyingcannot_restartstate uniformly without exposing string keys across files.🎮 Turn Lifecycle & Buttons
Buttons/Turn.pyrestartTurnto callplayer_helper.cannotRestart(), throwing a clear, ephemeral layout failure block if triggered.endTurnto automatically clear the lockout state viaplayer_helper.setCannotRestart(False)when the player finishes their round.Buttons/Explore.pyplayer_helper.setCannotRestart(True)right at the start of resolution hooks to lock turn modification upon discovering sector layout data.Buttons/Research.pyplayer_helper.setCannotRestart(True)whenever a standard tech discovery tile is drawn or when Magellan triggers their 4th tech track milestone discovery tile.👑 Admin & Override Commands
commands/player_commands.py/player set_cannot_restart [cannot_restart: bool] [player: Member]to ease in-game tracking, edge case troubleshooting, or manual operator overrides.Notes
** This does not interfere or break with feature "Undo Last Turn"