Cockatrice/libcockatrice_utility/libcockatrice/utility
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
..
card_ref.h [DeckList] Move metadata into struct (#6380) 2025-11-30 13:09:09 +01:00
color.h [Game][Counters] Split counters into AbstractCounter (graphics) and CounterState (logic) (#6917) 2026-05-21 20:16:28 +02:00
expression.cpp style: Add braces to all control flow statements (#6887) 2026-05-16 19:19:53 +02:00
expression.h Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
levenshtein.cpp style: Add braces to all control flow statements (#6887) 2026-05-16 19:19:53 +02:00
levenshtein.h Standardize Doxygen documentation (#6885) 2026-05-21 22:58:07 +02:00
macros.h Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
passwordhasher.cpp Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
passwordhasher.h Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
peglib.h Update external c libs: SFMT & peglib (#6901) 2026-05-22 03:31:59 +02:00
qt_utils.h style: Add braces to all control flow statements (#6887) 2026-05-16 19:19:53 +02:00
trice_limits.h Centralize counter API with server-side bounds and no-op filtering (#6879) 2026-05-21 20:39:35 -07:00
zone_names.h Refactor zone names (#6686) 2026-03-12 00:34:05 +01:00