라이어 게임: 관리자 화면에서 주제·제시어 추가/수정/삭제, 바보 모드 라이어는 비슷한 단어(같은 묶음)

- 제시어 1,519개를 주제별 '비슷한 단어 묶음' 391개로 정리(bank/*.ts groups). 바보 모드 라이어는 제시어와 같은 묶음의 다른 단어를 받음
- 관리자 → 라이어 제시어(/admin/liar): 주제 추가·이름 변경·삭제(내장 주제는 다시 살리기/처음 값으로), 제시어·묶음·다른 표기·컴퓨터 설명 편집, 저장 시 topicProblems 검사
- 저장: liar_topics(바뀐 주제), liar_bank_versions(판본). 새 판 옵션에 bank 판본을 붙여(prepareOptions) 다시 보기·복구가 같은 은행 사용
- 판 상태에 주제 이름·단어 목록·다른 표기를 복사해 진행 중 판은 관리자 수정의 영향을 받지 않음
- 대기실 주제 목록은 GET /api/liar/topics, 관리자 API /api/admin/liar/topics, 기록 liar.topic.*
- 테스트: 엔진(묶음·바보 모드·판본·검사), 서버(관리자 API·새 판·재시작), E2E(관리자 편집 → 대기실 새 주제)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-18 04:16:17 +09:00
parent 5a878ba991
commit 1bd69200fd
46 changed files with 1639 additions and 75 deletions

View File

@@ -60,6 +60,11 @@ export interface GameDefinition<S, A, V, O> {
ownChat?: boolean;
/** Extra player-count rule `playersFor` cannot express (e.g. even counts only); Korean reason or null. */
playerCountError?(options: O, count: number): string | null;
/**
* Server only, right before a game starts: adds data the server decides to the (already validated) options, e.g. the
* version of an admin-edited word bank. The result is stored with the game, so a replay sets up from the same data.
*/
prepareOptions?(options: O): O;
setup(ctx: SetupContext<O>): S;
/** `ctx.now` is passed by the server (real-time games may rate-limit with it); tests may omit it. */
validate(state: S, actor: PlayerId, action: A, ctx?: ValidateContext): Validation;