Use @pokertools/engine and evaluator for poker rules and hand ranking

Replace the hand-rolled betting rules, side pots, showdown and hand
evaluator with the published @pokertools/engine and @pokertools/evaluator
libraries (MIT, pinned to 2.1.0).

- server/hand.js now wraps a PokerEngine per hand: it maps seats,
  mirrors stacks, staggers the all-in runout, and pays host-chosen
  winners on cash-only tables.
- server/cards.js and server/ai.js use the library evaluator.
- Out-of-turn folds go through the engine's stand; all-in hands stay
  live when the player leaves; uncalled bets return to a leaver.
- The engine refuses some check-able folds that would leave a side pot
  without eligible players; those now return a message (or check for
  a leaving player) instead of crashing.
- BB must be greater than SB (engine requirement); Node >= 24.
- Tests rig cards via engine snapshots and cover the new edge cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
agomizi1cmandClaude Opus 5.5 committed 2026-10-17 17:25:15 +09:00
1 parent 02c8e76237
commit d92953a270
9 files changed
+410 -382

No files matched your search

+3 -1
View File
@@ -10,9 +10,11 @@
"test": "node --test"
},
"engines": {
"node": ">=18"
"node": ">=24"
},
"dependencies": {
"@pokertools/engine": "2.1.0",
"@pokertools/evaluator": "2.1.0",
"express": "^4.22.3",
"socket.io": "^4.8.4"
}