Commit graph

4 commits

Author SHA1 Message Date
DawnFire42
240ca7029f
Refine command zone counters and unify counter clamp arithmetic
- Route value updates through the virtual setValue() so
      CommanderTaxCounter's tooltip tracks the live value instead of
      freezing at its initial value
    - Reject deletion of reserved tax counters in cmdDelCounter; they are
      server-managed and must persist for the game
    - Register aMoveToCommandZone and aViewCommandZone as bindable
      shortcuts, matching their sibling move/view zone actions
    - Extract overflow-safe clamped addition into addClamped(), shared by
      Server_Card and Server_Counter instead of duplicated
    - Update stale comments: the clip-container note (now used by
      CommandZone) and CommandZone's layout docs (defer to
      SelectZone::layoutCardsVertically)
2026-06-19 11:00:58 -04:00
DawnFire42
75d59e2d82
[Game] Add Command Zone support with commander tax tracking
- Add CommandZone and CommandZoneLogic for commander
  - Add CommanderTaxCounter
  - Add counter active state protocol (show/hide tax counters)
  - Add "Enable Command Zone" option in game creation dialogs
  - Add context menu actions for command zone operations

Took 9 minutes

Took 11 minutes
2026-06-19 11:00:49 -04:00
DawnFire42
8dca14933c
Centralize counter API with server-side bounds and no-op filtering (#6879)
* Refactor server counter API to own overflow protection and filter no-op events

  Counter modifications now clamp to int bounds server-side and return change
  status, allowing command handlers to skip network broadcasts when values
  don't actually change.

* Centralize MAX_COUNTERS_ON_CARD and enforce [0, 999] bounds on server

  - Move MAX_COUNTERS_ON_CARD to trice_limits.h
  - Server clamps values in setCounter() and incrementCounter()
  - Client uses clamped comparison to allow recovery from invalid states
  - Add tests for clamping behavior

* move incrementCount() implementation from header to cpp
2026-05-21 20:39:35 -07:00
BruebachL
1ef07309d6
Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2025-10-09 07:36:12 +02:00
Renamed from common/trice_limits.h (Browse further)