채팅을 따로 분리해 속도 제한 없이: 방 채팅·마피아·라이어·그림 맞히기(그리기 전) 채팅의 줄 간격 제한(chat-pace)과 브라우저 대기열을 없애 치는 대로 바로 보냄. 서버 연결당 공용 한도(초당 20개)를 채팅·입력 중 신호가 같이 써서 빠르게 치면 15번째 줄부터 조용히 사라지던 문제도: 채팅은 별도 한도(초당 50, 최대 200, 매크로 도배 방지용)로 분리. 게임 채팅은 보내는 동안 게임 버튼을 잠그지 않음(pending 미설정)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 08:58:17 +09:00
parent 13a89a645e
commit 4d1deb8346
26 changed files with 122 additions and 162 deletions

View File

@@ -238,13 +238,17 @@ class GameSocket {
useRoom.setState({ code: null, room: null, roomSeq: -1, game: null, result: null, chat: [], typing: {}, pending: null });
}
/** Sends a game action; returns false when not connected. */
/**
* Sends a game action; returns false when not connected. A game's chat line (`type: 'chat'`) is sent on its own:
* it does not mark the board as waiting, so typing never locks the game's buttons and lines never wait on each other.
*/
act(a: unknown): boolean {
const cs = ++this.cs;
if (!this.send({ t: 'act', cs, a })) {
toast('연결이 끊겨 있어요. 다시 연결되면 해 주세요.', 'error');
return false;
}
if ((a as { type?: unknown } | null)?.type === 'chat') return true;
useRoom.setState({ pending: cs, slow: false });
if (this.pendingTimer) clearTimeout(this.pendingTimer);
this.pendingTimer = setTimeout(() => {