채팅을 따로 분리해 속도 제한 없이: 방 채팅·마피아·라이어·그림 맞히기(그리기 전) 채팅의 줄 간격 제한(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

@@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from 'react';
import { CHAT_MAX, EMOTE_LABEL, EMOTES, type PublicUser, type RoomView } from '@bg/shared/lite';
import { create } from 'zustand';
import { socket, useRoom } from '../net/socket';
import { useChatOutbox, useTypingSignal } from '../lib/chat-input';
import { useTypingSignal } from '../lib/chat-input';
import { useStickToBottom } from '../lib/useStickToBottom';
import { BotActivity } from './BotActivity';
import { ChatMessage, sameRun } from './ChatMessage';
@@ -16,7 +16,7 @@ export function ChatPanel({ room, me, title = true }: { room: RoomView; me: Publ
const [text, setText] = useState('');
const { ref: listRef, pin } = useStickToBottom<HTMLDivElement>();
const inputRef = useRef<HTMLInputElement>(null);
const send = useChatOutbox((t) => socket.send({ t: 'chat', text: t }));
const send = (t: string) => socket.send({ t: 'chat', text: t });
const typing = useTypingSignal('room', room.chatEnabled);
const lastId = chat.at(-1)?.id ?? 0;
useEffect(() => {