From ac37a6a6d83a56e24715f13a89ef8cbafc5abfce Mon Sep 17 00:00:00 2001 From: EJClaw Date: Tue, 13 Oct 2026 13:04:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B9=B4=EB=93=9C=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EB=AC=B4=EC=A0=9C=ED=95=9C(=EC=9A=B0?= =?UTF-8?q?=EB=85=B8=C2=B7=EB=B1=85!=C2=B7=EB=8B=AC=EB=AC=B4=ED=8B=B0?= =?UTF-8?q?=C2=B7=EA=B3=A0=EC=8A=A4=ED=86=B1=C2=B7=EB=8F=84=EB=91=91?= =?UTF-8?q?=EC=9E=A1=EA=B8=B0=C2=B7=ED=8F=AC=EC=BB=A4=C2=B7=EB=B0=94?= =?UTF-8?q?=ED=80=B4=EB=B2=8C=EB=A0=88=20=ED=8F=AC=EC=BB=A4=C2=B799),=20?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=20=EC=B9=B4=EB=93=9C=20=EC=9B=80=EC=A7=81?= =?UTF-8?q?=EC=9E=84(card-fx),=20=EC=9A=B0=EB=85=B8=C2=B7=EB=8B=AC?= =?UTF-8?q?=EB=AC=B4=ED=8B=B0=C2=B7=EB=8F=84=EB=91=91=EC=9E=A1=EA=B8=B0?= =?UTF-8?q?=C2=B7=ED=8F=AC=EC=BB=A4=20=EC=86=8C=EB=A6=AC=C2=B7=EC=95=A0?= =?UTF-8?q?=EB=8B=88=EB=A9=94=EC=9D=B4=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 무제한(null): 차례 시계·타임아웃 없음, 자리 비움만 짧은 시계, 연결 끊김은 방 유예 뒤 자동 행동 그대로 - 포커는 리바이 고르는 시간도 무제한 가능, 고스톱은 고·스톱 선택 시간도 무제한 가능, 뱅!은 반응 시간·캐릭터 고르기도 - card-fx: 날아가는 카드·칩(ghost), 제자리 날아오기, 배너, view 변화 감지 훅(처음 렌더·다시 보기는 건너뜀) Co-Authored-By: Claude Opus 5.5 --- apps/server/src/rooms/uno.room.test.ts | 18 +- apps/web/src/games/bang/help.ts | 2 +- apps/web/src/games/bang/index.tsx | 21 +- apps/web/src/games/card-fx.tsx | 228 +++++++++++++ apps/web/src/games/cockroach-poker/index.tsx | 8 +- apps/web/src/games/dalmuti/index.tsx | 176 +++++++++- apps/web/src/games/gostop/help.ts | 13 +- apps/web/src/games/gostop/index.tsx | 16 +- apps/web/src/games/ninety-nine/index.tsx | 8 +- apps/web/src/games/old-maid/index.tsx | 183 ++++++++++- apps/web/src/games/poker/index.tsx | 305 ++++++++++++++++-- apps/web/src/games/uno/index.tsx | 158 ++++++++- docs/games/bang.md | 6 +- docs/games/cockroach-poker.md | 2 +- docs/games/dalmuti.md | 4 +- docs/games/gostop.md | 6 +- docs/games/ninety-nine.md | 4 +- docs/games/old-maid.md | 6 +- docs/games/poker.md | 10 +- docs/games/uno.md | 5 +- packages/games/src/bang/bang.test.ts | 73 ++++- packages/games/src/bang/effects.ts | 31 +- packages/games/src/bang/index.ts | 22 +- packages/games/src/bang/types.ts | 36 ++- .../cockroach-poker/cockroach-poker.test.ts | 19 +- packages/games/src/cockroach-poker/index.ts | 17 +- packages/games/src/dalmuti/dalmuti.test.ts | 24 ++ packages/games/src/dalmuti/index.ts | 12 +- packages/games/src/dalmuti/types.ts | 10 +- packages/games/src/gostop/gostop.test.ts | 23 ++ packages/games/src/gostop/index.ts | 4 +- packages/games/src/gostop/types.ts | 12 +- packages/games/src/ninety-nine/index.ts | 4 +- .../games/src/ninety-nine/ninety-nine.test.ts | 14 + packages/games/src/ninety-nine/types.ts | 7 +- packages/games/src/old-maid/index.ts | 11 +- packages/games/src/old-maid/old-maid.test.ts | 22 ++ packages/games/src/old-maid/types.ts | 6 +- packages/games/src/poker/hand.ts | 17 +- packages/games/src/poker/options.ts | 15 +- packages/games/src/poker/poker.test.ts | 48 +++ packages/games/src/uno/index.ts | 7 +- packages/games/src/uno/types.ts | 7 +- packages/games/src/uno/uno.test.ts | 16 + 44 files changed, 1438 insertions(+), 198 deletions(-) create mode 100644 apps/web/src/games/card-fx.tsx diff --git a/apps/server/src/rooms/uno.room.test.ts b/apps/server/src/rooms/uno.room.test.ts index 4877a56..0f503ce 100644 --- a/apps/server/src/rooms/uno.room.test.ts +++ b/apps/server/src/rooms/uno.room.test.ts @@ -28,7 +28,7 @@ function practice(options: Record = {}) { room.addBot('A'); room.configure('A', { options: { ...(room.config.options as object), ...options } }); expect(room.start('A')).toBeNull(); - return { room, clock, msgs }; + return { room, clock, msgs, a }; } /** Bots move at once; when the game waits on the person, they play their first legal action (or the clock runs out). */ @@ -72,3 +72,19 @@ test('500 points with house rules: the person only times out, the computers stil const view = JSON.stringify(GAMES.uno!.view(s, 'A')); for (const bot of s.seats.filter(isBotId)) for (const c of s.hands[bot]!) expect(view).not.toContain(`"${c.id}"`); }); + +test('무제한 time: no clock while the person is here; a dropped connection is still auto-played after the grace time', () => { + const { room, clock, a } = practice({ turnSeconds: null }); + // Let the computers move until the game waits on the person. + for (let i = 0; i < 200 && room.bots.dueAt !== null; i++) room.bots.fire(); + const s = () => room.game!.state as UnoState; + expect(GAMES.uno!.activePlayers(s())).toContain('A'); + expect(room.effectiveDeadline()).toBeNull(); + const turn = s().turnNo; + room.disconnect(a); + const d = room.effectiveDeadline(); + expect(d).not.toBeNull(); + clock.advance(d! - clock.advance(0) + 1); + room.onTimer(); + expect(s().turnNo !== turn || s().log.some((e) => e.t === 'timeout' && e.p === 'A')).toBe(true); +}); diff --git a/apps/web/src/games/bang/help.ts b/apps/web/src/games/bang/help.ts index bda8e8f..7b1a436 100644 --- a/apps/web/src/games/bang/help.ts +++ b/apps/web/src/games/bang/help.ts @@ -77,7 +77,7 @@ export function helpNow(v: BangView, me: string | null, players: Record= p.needed) { const label = use.map((c) => NAME[c.kind as 'bang' | 'missed'] ?? '빗나감!').join(' + '); lines.push(`[${label} 내기]를 누르면 막아요. 막지 않으려면 [맞기 (생명 −1)]를 눌러요.`); - if (v.options.autoDefend) lines.push('시간 안에 고르지 않으면 막을 카드를 자동으로 내요.'); + if (v.options.autoDefend) lines.push(v.options.reactionSeconds === null ? '반응 시간 제한은 없어요. 연결이 끊긴 채 오래 돌아오지 않으면 막을 카드를 자동으로 내요.' : '시간 안에 고르지 않으면 막을 카드를 자동으로 내요.'); } else lines.push(`막을 카드가 ${p.options.length > 0 ? '모자라요' : '없어요'}. [맞기 (생명 −1)]를 눌러요.`); if (p.canBarrel) lines.push('[술통 판정하기]를 누르면 카드를 한 장 뒤집어 ♥가 나올 때 피해요.'); lines.push(life); diff --git a/apps/web/src/games/bang/index.tsx b/apps/web/src/games/bang/index.tsx index 95f33e8..755390c 100644 --- a/apps/web/src/games/bang/index.tsx +++ b/apps/web/src/games/bang/index.tsx @@ -1034,7 +1034,7 @@ function BangSide({ view: v, me, players }: BoardProps) { {v.winner ? ' · 게임 끝' : ''} - 카드 더미 {v.deckCount}장 · 버린 카드 {v.discardCount}장 · 반응 {v.options.reactionSeconds}초 · 턴 {v.options.turnSeconds}초 + 카드 더미 {v.deckCount}장 · 버린 카드 {v.discardCount}장 · {secText('반응', v.options.reactionSeconds)} · {secText('턴', v.options.turnSeconds)}
    {v.players.map((p) => ( @@ -1132,7 +1132,7 @@ function statusText(v: BangView, me: string | null, players: Record({ value, options, onChange, label }: { value: T; options: [T, string][]; onChange: (v: T) => void; label: string }) { +function Seg({ value, options, onChange, label }: { value: T; options: [T, string][]; onChange: (v: T) => void; label: string }) { return (
    {options.map(([k, l]) => ( @@ -1168,10 +1168,10 @@ function Options({ value: o, onChange }: OptionsProps) { set({ characterDraft })} /> - set({ turnSeconds })} /> + set({ turnSeconds })} /> - - set({ reactionSeconds })} /> + + set({ reactionSeconds })} />