결과는 움직임이 끝날 때까지(시간 상한 없음), 제한 시간은 각자 화면이 연출을 다 보여 준 뒤부터
- lib/motion: useMotionSettled에서 12초 상한을 없앰(명시한 maxMs만) - 서버: 클라이언트 settled(seq)를 받으면 그 사람의 제한 시간을 연출에 걸린 만큼 늦춤(보고 전에는 최대 15초×속도, 보고한 적 없는 화면·컴퓨터·실시간 게임은 예전 그대로), 마감이 바뀌면 deadline 메시지 - 바퀴벌레 포커: 게임을 끝낸 판정은 패배 배너까지 다 끝난 뒤에 끝 화면 - 증강 윷놀이: 선택 창 열림을 후보 묶음마다 따로, 이의있음! 재선택 창은 이의있음! 화면이 사라진 뒤에 - e2e/motion.e2e.ts: 30초 움직임·바퀴벌레 포커 마지막 판정·이의있음! 재선택·다빈치 ×1/8 회귀 확인, 방 타이머 단위 테스트 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,11 @@ export interface GameDefinition<S, A, V, O> {
|
||||
* secret (아발론's assassin) hide that pull-forward; the room still times out on the effective deadline.
|
||||
*/
|
||||
publicDeadline?(state: S, effective: number | null): number | null;
|
||||
/**
|
||||
* Real-time game (할리갈리, 도블, 사과 게임, 그림 맞히기): clocks run from the moment the state changes. In other games a
|
||||
* player's clock starts once their screen has finished animating the change (client `settled`, room `revealExtra`).
|
||||
*/
|
||||
realtime?: boolean;
|
||||
/** Grace period (ms) for disconnected timed players in this state, overriding the room's `graceSec`; null = room default. */
|
||||
disconnectGraceMs?(state: S): number | null;
|
||||
onTimeout(state: S, player: PlayerId): A;
|
||||
|
||||
@@ -289,6 +289,7 @@ type Def = GameDefinition<S, A, AppleView, AppleOptions>;
|
||||
export const apple: Def = {
|
||||
id: 'apple',
|
||||
nameKo: '사과 게임',
|
||||
realtime: true,
|
||||
minPlayers: 1,
|
||||
maxPlayers: MAX_PLAYERS,
|
||||
stateVersion: 1,
|
||||
|
||||
@@ -547,6 +547,7 @@ function buildView(s: S, viewer: PlayerId | null, withCanvas: boolean): Catchmin
|
||||
export const catchmind: GameDefinition<S, A, CatchmindView, CatchmindOptions> = {
|
||||
id: 'catchmind',
|
||||
nameKo: '그림 맞히기',
|
||||
realtime: true,
|
||||
minPlayers: 2,
|
||||
maxPlayers: 10,
|
||||
stateVersion: 1,
|
||||
|
||||
@@ -652,6 +652,7 @@ const SCORE_TEXT: Record<MiniGame, (r: RankRow) => string> = {
|
||||
export const dobble: Def = {
|
||||
id: 'dobble',
|
||||
nameKo: '도블',
|
||||
realtime: true,
|
||||
minPlayers: 2,
|
||||
maxPlayers: 8,
|
||||
stateVersion: 1,
|
||||
|
||||
@@ -389,6 +389,7 @@ const LATE_FLIP = '늦었어요! 그 사이에 카드가 바뀌었어요.';
|
||||
export const halliGalli: GameDefinition<S, A, HalliGalliView, HalliGalliOptions> = {
|
||||
id: 'halli-galli',
|
||||
nameKo: '할리갈리',
|
||||
realtime: true,
|
||||
minPlayers: 2,
|
||||
maxPlayers: 6,
|
||||
stateVersion: 1,
|
||||
|
||||
@@ -40,6 +40,8 @@ export const ClientMessage = z.discriminatedUnion('t', [
|
||||
z.object({ t: z.literal('rematch') }),
|
||||
z.object({ t: z.literal('void') }),
|
||||
z.object({ t: z.literal('sync') }),
|
||||
/** This screen has finished animating the game state `seq` (the player's turn clock starts now). */
|
||||
z.object({ t: z.literal('settled'), seq: z.number().int().min(0) }),
|
||||
z.object({ t: z.literal('ping'), ts: z.number() }),
|
||||
]);
|
||||
export type ClientMessage = z.infer<typeof ClientMessage>;
|
||||
|
||||
@@ -123,6 +123,8 @@ export type ServerMessage =
|
||||
}
|
||||
/** Events of streaming actions (e.g. drawing), relayed without a full view (docs/games/catchmind.md §5.5). */
|
||||
| { t: 'stream'; seq: number; events: unknown[]; cs?: number }
|
||||
/** The game's deadline moved without a state change (a player's screen finished animating: their clock started). */
|
||||
| { t: 'deadline'; deadline: number | null }
|
||||
| { t: 'reject'; cs: number; reason: string }
|
||||
/** `replay`: an earlier line resent on (re)joining, so the client shows it without the chat sound. */
|
||||
| { t: 'chat'; from: PublicUser | null; text: string; at: number; channel?: string; replay?: true }
|
||||
|
||||
Reference in New Issue
Block a user