채팅 소리(스타크래프트 같은 "띠릭"): 새 채팅 줄마다(내가 보낸 줄도) 맑은 두 음이 올라가는 짧은 소리. 크기는 게임 소리 기준(0.15)의 90%로 소리 크기 설정을 그대로 따르고, 소리 끄기면 안 남. 몰려 온 줄은 한 번만. 방에 (다시) 들어올 때 서버가 다시 보내는 지난 채팅은 replay 표시로 조용히. 마피아·라이어 게임 안 채팅도 같은 소리. feedback.test.ts, room.test.ts, chat.e2e.ts에 확인 추가
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,8 @@ export interface ChatLine {
|
||||
from: PublicUser | null;
|
||||
text: string;
|
||||
at: number;
|
||||
/** Arrived just now (not resent history on joining): plays the chat sound. */
|
||||
live: boolean;
|
||||
}
|
||||
|
||||
export interface GameState {
|
||||
@@ -307,7 +309,7 @@ class GameSocket {
|
||||
useRoom.setState({ result: m.result });
|
||||
break;
|
||||
case 'chat':
|
||||
useRoom.setState({ chat: [...st.chat, { id: this.chatId++, from: m.from, text: m.text, at: m.at }].slice(-100), typing: withoutTyping(st.typing, m.from?.id) });
|
||||
useRoom.setState({ chat: [...st.chat, { id: this.chatId++, from: m.from, text: m.text, at: m.at, live: !m.replay }].slice(-100), typing: withoutTyping(st.typing, m.from?.id) });
|
||||
break;
|
||||
case 'typing':
|
||||
if (m.on) {
|
||||
|
||||
Reference in New Issue
Block a user