Add App.confirm() in common.js: a promise-based dialog styled like the
site's modals, with a title, multi-line message and custom button labels.
Destructive actions use a red OK button and focus Cancel by default;
Escape and backdrop clicks cancel, and Tab stays inside the dialog.
Use it for folding when a check is possible, leaving the table,
confirming showdown winners and deleting tables from the lobby. After the
dialog closes, re-check that the action is still valid (turn not passed,
pot not already awarded, table still listed) before sending it.
Also add a "poker-test" launch config that runs on port 4672 with the
example keys from .env.example, for local browser testing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admins see a "削除" button on every table in the lobby. It calls the new
admin-only DELETE /api/tables/:id (404 for non-admins, same-origin only),
which closes the table the same way as when every human leaves. Players
and spectators still at the table are told "管理者がテーブルを削除しました。"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new table type, "review" (レビュー付きCPU戦), can only be created by
admins. Only the creator and CPUs sit there: friends cannot join, and the
table is hidden from non-admin lobbies. After every hand a review opens,
and the next hand waits until the creator presses "次のハンドへ".
- Preflop: shows which color of the registered hand range the hole cards
are and whether the action followed it. With no entrant before you,
open with the color for the number of players still to act; facing an
entrant, estimate their range from their position, call one color
above it and raise two above. Purple ranks just below white (SB only).
- Flop onward: equity vs ranges estimated from those colors (narrowed by
later bets/calls) gives a rough EV per option. The score is the EV lost
against the best option, relative to the pot. It is a guide, not GTO.
- Also: pot-odds call check, all-in equity and luck-adjusted P&L,
VPIP/PFR/3bet/Cbet/WTSD/W$SD/AF, per-color and per-position compliance,
habits to watch, worst-5 hands, a P&L chart and a step-by-step replay
on the admin-only /review page.
Hand now logs every action for the review. The range data moves to
admin/range-data.js, shared by the range page and the server. Reviews are
saved under data/reviews/ (newest 50 sessions). Admin scripts and CSS are
no longer cached for a day, so updates show up immediately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Create screen: choose キャッシュオンリー (real cards, chips only), 友人戦
(server deals and settles) or CPU戦 (友人戦 plus 1–8 CPU players); replaces
the card toggle. The lobby shows each table's type
- Poker AI written from scratch (server/ai.js, no libraries): fast 7-card
evaluator (checked against bestHand), Monte Carlo equity, and decisions from
hand rank, pot odds, raise count, opponents and a per-CPU style (aggression,
bluff rate); continuation bets via the last aggressor. It never sees other
players' hole cards
- CPU seats: think time of 0.7–1.8s (faster when no human is left in the hand),
automatic rebuy, never the host, no new hand unless a human is playing,
re-think after pause
- Play UI: robot avatars and a "考えています…" status for CPU turns
- Tests for the evaluator, equity, legality of AI actions and CPU tables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New "カードを配る" switch on the create-table screen (default off); the lobby
shows "カードあり" for tables that use it
- Card mode (server/cards.js restored): crypto-shuffled deck kept server-side,
hole cards sent only to their owner until showdown/all-in reveal, board dealt
per street with burns, all-in runout on a timer (frozen while paused)
- Showdown is evaluated and every pot (incl. side pots, split pots) is paid out
automatically; host winner selection is only used when card mode is off
- Play UI: board, hole cards, own cards in the action bar, hand names, winning
cards highlighted; layout tuned for 7+ seats and short screens
- Playing-card styles use .pcard so they don't clash with the existing .card panel
- Tests for hand evaluation, card privacy, runout, side pots, ties and random play
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Optional ADMIN_KEY (6 digits, distinct from ACCESS_KEY): entering it on the
key screen signs in as admin (role-specific HMAC cookie; member cookies
stay valid). Logged-in members can open /key?admin to enter it.
- /range (range chart + color/category quiz, ported from poker-hand and
restyled to the site design) and its files under admin/ are served only to
admins; everyone else gets 404. Card images cached privately for a day.
- Lobby shows a link to the page for admins only (GET /api/me).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>