mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-06 02:33:48 -05:00
bbccaaa701
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
18b23b19a7
|
Split trice_limits.h into dedicated headers (#7025)
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Docker Image / amd64 & arm64 (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Debian, DEB, 13) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Debian, DEB, skip, 12) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Fedora, RPM, 44) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Fedora, RPM, skip, 43) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Servatrice_Debian, DEB, yes, skip, 12) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Ubuntu, DEB, 26.04) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Ubuntu, DEB, skip, 24.04) (push) Has been cancelled
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (yes, Arch, skip) (push) Has been cancelled
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, -macOS14, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-14, Apple, 14, Release,… (push) Has been cancelled
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, -macOS15, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15, Apple, 15, Release,… (push) Has been cancelled
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, 13, -macOS13_Intel, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15-intel, Int… (push) Has been cancelled
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, macOS, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15, Apple, 15, Debug, 1, 16.4) (push) Has been cancelled
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (Visual Studio 18 2026, x64, 1, Windows, -Win10, win64_msvc2022_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, win… (push) Has been cancelled
Update Translation Source / Push strings (push) Has been cancelled
* Split trice_limits.h into dedicated headers * Updated docstrings |
||
|
|
05ae6f47a6
|
Unify counter clamp arithmetic into shared addClamped() helper (#7009)
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Debian, DEB, 13) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Debian, DEB, skip, 12) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Fedora, RPM, 44) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Fedora, RPM, skip, 43) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Servatrice_Debian, DEB, yes, skip, 12) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Ubuntu, DEB, 26.04) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (Ubuntu, DEB, skip, 24.04) (push) Blocked by required conditions
Build Desktop / ${{ matrix.distro }} ${{ matrix.version }} (yes, Arch, skip) (push) Blocked by required conditions
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, -macOS14, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-14, Apple, 14, Release,… (push) Blocked by required conditions
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, -macOS15, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15, Apple, 15, Release,… (push) Blocked by required conditions
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, 1, macOS, 13, -macOS13_Intel, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15-intel, Int… (push) Blocked by required conditions
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (7d, Ninja, macOS, clang_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, macos-15, Apple, 15, Debug, 1, 16.4) (push) Blocked by required conditions
Build Desktop / ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (Visual Studio 18 2026, x64, 1, Windows, -Win10, win64_msvc2022_64, qtimageformats qtmultimedia qtwebsockets, 6.11.0, win… (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* Unify counter clamp arithmetic into shared addClamped() helper - Add addClamped() in new header clamped_arithmetic.h; uses a 64-bit intermediate so the addition cannot overflow int. - Use it in Server_Card::incrementCounter() (clamps [0, MAX_COUNTERS_ON_CARD]) and Server_Counter::incrementCount() (clamps [INT_MIN, INT_MAX]), removing the duplicated overflow-safe logic and its keep-in-sync TODO. - Inline incrementCount() into server_counter.h; server_counter.cpp now holds only the constructor and getInfo(). - Clarify the card-counter bounds comment in trice_limits.h. * Rename MAX_COUNTERS_ON_CARD to MAX_COUNTER_VALUE The constant caps the counter's value, not how many counters can be on the card * Add direct unit tests for addClamped() helper * Harden offsetCardCounter() against signed-int overflow Replace the raw oldValue + offset sum with addClamped(), clamping to [0, MAX_COUNTER_VALUE] without overflow. * Comment update * Remove class names from addClamped() docstring |
||
|
|
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 |