Files
game_voice_recorder/packages/shared/src/live-game.ts
EJClaw fa6126e17f v1.3.6: 목소리 깨짐(RTP 기준 쉼 채우기) · 알 수 없음 · 잡음 숨기기/삭제 · 사이트 로그 · 지금 게임 · TTS 속도 · 시작 창
- 녹음기: 패킷 도착 간격 대신 RTP 타임스탬프로 자리를 정한다. 게임 중 몰려 온 패킷 사이에 무음이 끼어 목소리가 깨졌다. 예전 녹음은 한 번 고친 뒤 다시 변환
- users.updated 를 빈 목록으로 보내 사이트에서 말한 사람이 '알 수 없음'이 되던 것
- 잡음은 숨기고 ogg 삭제, 로그에 잡음으로 남김. 짧은 목소리도 Whisper 로, 반복 고리는 줄여서 보여 줌
- 사이트: 재생 음량, 발화 우클릭(자세한 정보 · ogg 다운로드), 사이트 로그(/logs, 게임 PC 꺼져도), 지금 게임 상태
- 앱: 지금 게임 상태, 녹음 안내 말 속도 0.1~2.0, 포터블 · 앱 시작 창
- 발로란트 데스매치 가짜 라운드 · 에이스, 빈 선수 이름

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:01:14 +09:00

36 lines
2.0 KiB
TypeScript

import type { LiveGame } from './protocol.js';
import { fmtClock } from './time.js';
export const GAME_NAME: Record<LiveGame['game'], string> = { valorant: '발로란트', lol: '리그 오브 레전드' };
/** 지금 게임 상태를 한 줄로 (헤더 · 알림용): "경쟁전 · 어센트 · R15 8:6" */
export function liveGameLine(g: LiveGame): string {
if (!g.inMatch) return g.phase + (g.mode && g.connected ? ` · ${g.mode}` : '');
const parts = [g.mode, g.map].filter(Boolean) as string[];
if (g.round != null && g.score) parts.push(`R${g.round} ${g.score.ally}:${g.score.enemy}`);
else if (g.score) parts.push(`${g.score.ally}:${g.score.enemy}`);
if (g.gameTimeSec != null) parts.push(fmtClock(g.gameTimeSec * 1000));
return parts.join(' · ') || '경기 중';
}
/** 지금 게임 상태 자세히 (앱 게임 연동 탭 · 사이트 패널): [항목, 값] */
export function liveGameRows(g: LiveGame, now = Date.now()): [string, string][] {
const rows: [string, string][] = [['상태', g.phase]];
if (g.self?.name) rows.push(['내 계정', g.self.name]);
if (g.mode) rows.push(['모드', g.mode]);
if (g.map) rows.push(['맵', g.map]);
if (g.inMatch) {
if (g.round != null) rows.push(['라운드', `${g.round}라운드`]);
if (g.score) rows.push([g.round != null ? '점수 (우리 : 상대)' : '점수', `${g.score.ally} : ${g.score.enemy}`]);
if (g.gameTimeSec != null) rows.push(['게임 시간', fmtClock(g.gameTimeSec * 1000)]);
else if (g.startedAt) rows.push(['경과', fmtClock(Math.max(0, now - g.startedAt))]);
if (g.teamKills) rows.push(['팀 킬 (우리 : 상대)', `${g.teamKills.ally} : ${g.teamKills.enemy}`]);
if (g.self?.character) rows.push([g.game === 'lol' ? '내 챔피언' : '내 요원', g.self.character]);
if (g.self?.kda) rows.push(['KDA', g.self.kda]);
if (g.self?.extra) rows.push(['내 성적', g.self.extra]);
if (g.players) rows.push(['인원', `${g.players}명`]);
}
if (g.error) rows.push(['오류', g.error]);
return rows;
}