Repository navigation
Enforce configurable hand card limits per game - #30
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds per-game hand-card limits to game configuration. The loader stores these limits by game ID. Card draws check held and pending cards against the configured limit. Bundled settings, player messaging, documentation and tests are updated. ChangesHand-card limits
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Player
participant TableManager
participant Cache
participant Messages
Player->>TableManager: Request a card draw
TableManager->>Cache: Read limit for the game ID
TableManager->>TableManager: Count held and pending cards
TableManager->>Messages: Send hand.limit when the positive limit is reached
TableManager-->>Player: Stop draw when the limit is reached
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This adds configurable per-game hand-card limits, enforced before a card is drawn. No actionable merge-blocking risk was identified. Normal CI and the DEV build check should still run before merge. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change adds a restrictive check within existing card-draw handling without expanding player privileges. Delivery and cleanup paths support the new counting rule. Remaining uncertainty concerns runtime validation and incomplete security coverage, rather than a confirmed vulnerability. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Comment |
Players could draw beyond a game's intended hand size at an idle table. Add per-game
hand-card-limitin games.yml: Hold'em defaults to 2 and Five-Draw to 5; omitted or nonpositive values allow unrestricted card counts.Enforce the limit before consuming a shoe card, counting held cards and cards in flight. Blocked automatic deals finish their callback, and discarding makes room again. The cap includes all cards held by a player, including Blackjack split groups; Blackjack and free play remain uncapped by default. Existing installations need the two new settings in games.yml.
Validation: