Merge branch 'm8/mafia' into codex/owner/grp_discord_joke-app

# Conflicts:
#	apps/server/src/rooms/room.ts
#	apps/web/src/games/registry.ts
#	apps/web/src/lib/catalog-ui.ts
#	e2e/games.e2e.ts
#	packages/engine/src/types.ts
#	packages/games/src/index.ts
#	packages/shared/src/catalog.ts
This commit is contained in:
EJClaw
2026-10-06 00:39:35 +09:00
16 changed files with 3238 additions and 14 deletions

View File

@@ -564,6 +564,7 @@ export class Room {
chat(userId: string, text: string): string | null {
if (!this.config.chatEnabled) return '이 방은 채팅을 쓰지 않아요.';
if (!this.isParticipant(userId)) return '방에 들어와야 채팅할 수 있어요.';
if (this.gameChatOnly()) return '게임 중에는 게임 화면의 채팅을 써 주세요.';
const now = this.now();
if (now - (this.lastChatAt.get(userId) ?? 0) < 500) return '조금 천천히 보내 주세요.';
this.lastChatAt.set(userId, now);
@@ -581,8 +582,13 @@ export class Room {
return null;
}
/** Games with their own chat channels (마피아) close the room chat while playing, so nothing leaks around them. */
private gameChatOnly(): boolean {
return (this.status === 'playing' || this.status === 'paused') && !!this.def.ownChat;
}
emote(userId: string, id: string): void {
if (!this.isParticipant(userId)) return;
if (!this.isParticipant(userId) || this.gameChatOnly()) return;
const now = this.now();
if (now - (this.lastChatAt.get(`e:${userId}`) ?? 0) < 500) return;
this.lastChatAt.set(`e:${userId}`, now);