채팅을 따로 분리해 속도 제한 없이: 방 채팅·마피아·라이어·그림 맞히기(그리기 전) 채팅의 줄 간격 제한(chat-pace)과 브라우저 대기열을 없애 치는 대로 바로 보냄. 서버 연결당 공용 한도(초당 20개)를 채팅·입력 중 신호가 같이 써서 빠르게 치면 15번째 줄부터 조용히 사라지던 문제도: 채팅은 별도 한도(초당 50, 최대 200, 매크로 도배 방지용)로 분리. 게임 채팅은 보내는 동안 게임 버튼을 잠그지 않음(pending 미설정)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,18 +228,15 @@ describe('윷놀이 room rules', () => {
|
||||
});
|
||||
|
||||
describe('Room chat (2026-10-13)', () => {
|
||||
test('a quick burst of lines all goes through; a flood is still stopped', () => {
|
||||
const { room, clock, conn } = harness();
|
||||
test('no pace limit: any number of lines in the same instant all go through, in order', () => {
|
||||
const { room, conn } = harness();
|
||||
const a = conn('A');
|
||||
const b = conn('B');
|
||||
room.join(a, 'player');
|
||||
room.join(b, 'player');
|
||||
for (let i = 0; i < 6; i++) expect(room.chat('A', `줄 ${i}`)).toBeNull();
|
||||
expect(room.chat('A', '도배')).toBe('조금 천천히 보내 주세요.');
|
||||
clock.advance(300);
|
||||
expect(room.chat('A', '0.3초 뒤')).toBeNull();
|
||||
expect(room.chat('A', '도배')).toBe('조금 천천히 보내 주세요.');
|
||||
expect(b.msgs.filter((m) => m.t === 'chat').map((m) => (m as { text: string }).text)).toEqual(['줄 0', '줄 1', '줄 2', '줄 3', '줄 4', '줄 5', '0.3초 뒤']);
|
||||
const lines = Array.from({ length: 30 }, (_, i) => `줄 ${i}`);
|
||||
for (const t of lines) expect(room.chat('A', t)).toBeNull();
|
||||
expect(b.msgs.filter((m) => m.t === 'chat').map((m) => (m as { text: string }).text)).toEqual(lines);
|
||||
});
|
||||
|
||||
test('typing at a person\'s pace (a line every 0.4 s) never waits', () => {
|
||||
|
||||
Reference in New Issue
Block a user