diff --git a/README.md b/README.md index aabf7a7..b7bc35b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - 설계·계획: [`docs/gemnoki-project-plan.pdf`](docs/gemnoki-project-plan.pdf), 개발 구조·인터페이스: [`docs/dev/ARCHITECTURE.md`](docs/dev/ARCHITECTURE.md) - 범인찾기 · 리플레이 동기화 계획서 v1.2 (결정 반영): [`docs/culprit-finder-plan.pdf`](docs/culprit-finder-plan.pdf) · 원본 · 비용 계산 · 프롬프트 초안: `docs/report/culprit/` (실제로 쓰는 프롬프트는 `site/server/prompt/`) - **제작 완료 보고서 (M0~M8)**: [`docs/gemnoki-final-report.pdf`](docs/gemnoki-final-report.pdf) · 단계별 테스트 기록: [`docs/dev/test-results.md`](docs/dev/test-results.md) -- Windows 실행 파일: Gitea 릴리스 [v1.3.2](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.3.2) (`GameVoiceRecorder-1.3.2-win-x64.zip` 권장, 단일 파일 `GameVoiceRecorder-1.3.2-portable.exe`) · 처음 버전 [v1.0.0](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.0.0) +- Windows 실행 파일: Gitea 릴리스 [v1.3.3](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.3.3) (`GameVoiceRecorder-1.3.3-win-x64.zip` 권장, 단일 파일 `GameVoiceRecorder-1.3.3-portable.exe`) · 처음 버전 [v1.0.0](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.0.0) ## 로그인 · 관리자 (v1.2.0~) @@ -19,6 +19,13 @@ - 앱은 시작할 때와 10분마다 등록 여부를 다시 확인한다. 등록이 해제되면 바로 잠그고 봇 · 녹음 · 사이트 연결을 멈춘다. 사이트 서버에 못 붙으면 마지막 확인 뒤 3일까지는 그대로 쓴다. - 서버 쪽: `site/server/src/app-auth.ts` (`/auth/app/*`, `/app/me`, `/app/admin/users`), 앱 쪽: `app/src/core/auth.ts`, 권한 목록: `app/src/core/roles.ts`. 로그인 E2E: `app/scripts/login-e2e.mts`. +## v1.3.3 바뀐 점 + +- **따라갈 사람 목록**: 녹음할 서버의 멤버가 모두 나온다. 내 계정이 맨 위, 그다음 관리자(최고 관리자 포함), 나머지는 이름순. 예전에는 봇이 서버를 지켜보기 전에 목록을 요청하면 사이트 서버가 거절했고 앱이 그 오류를 숨겨 "선택 안 함"만 보였다. 이제 가입한 서버면 바로 받고, 실패하면 오류와 다시 불러오기 버튼을 보여 준다. 녹음할 서버를 바꾸면 봇이 새 서버를 바로 지켜본다. 서버: `GET /app/admins` +- **롤 채팅은 API 로만**: 화면 글자 인식(OCR)을 앱 · 워커 · 빌드에서 모두 뺐다 (pywinrt · mss · Pillow 의존성 제거). 롤 클라이언트(LCU) API 로 챔피언 선택 · 게임 후 채팅을 받는다. 롤은 게임 중 전체 · 팀 채팅을 주는 API 가 없다 (LCU · 게임 클라이언트 API 모두, 비공식 포함). 게임 로그 파일(r3dlog)에 채팅이 남아 있으면 경기 뒤에 붙인다 +- **표시 이름 (실명 숨기기)**: 디스코드 아이디마다 보일 이름을 정하면 사이트(로그인 이름 · 대화 기록 · 유저 목록), 앱, 범인 분석에 그 이름만 쓰고 이미 저장된 이름도 바꾼다. 앱 🛡️ 관리자 탭에서 최고 관리자가 정한다. 서버: `GET /app/names`, `PUT /app/admin/names`, `node dist/cli.js name <아이디> [이름]` +- 저장소의 시연 · 테스트 데이터, 화면 캡처, 계획서 PDF 에서 실제 이름을 빼고 가짜 이름(하늘)으로 바꿨다 + ## 디스코드 봇 - 기본은 **겜녹이 봇으로 진행**: 토큰을 넣지 않아도 로그인만 하면 바로 연결된다. 봇은 사이트 서버가 디스코드에 연결하고, 앱은 로그인 토큰으로 서버 중계(`/app/bot/ws`)를 받는다. @@ -59,7 +66,7 @@ | M1 녹음 + STT 기본 | 따라가기·명령 참여, TTS 안내, 유저별 녹음, 대기열 STT, /녹음제외·참여 | ✅ 완료 ([실음성 테스트](docs/dev/test-results.md)) | | M2 사이트 서버 · 사이트 v1 | 디스코드 로그인, 연결 확인·잠금, 타임라인·따라 읽기·필터·검색·실시간 | ✅ 완료 · https://gvr.tkrmagid.kr 배포 | | M3 발로란트 연동 | 경기 감지, 킬·라운드·채팅, 라운드 시간 + 경기 경과 시간, 경기 상세 | ✅ 완료 ([전체 스택 테스트](docs/dev/test-results.md)) | -| M4 롤 연동 · 채팅 OCR | 게임 API 이벤트, LCU 결과·타임라인, 채팅 OCR·로그, 롤 경기 상세 | ✅ 완료 (Windows 실기 확인: [기록](docs/dev/test-results.md)) | +| M4 롤 연동 · 채팅 OCR | 게임 API 이벤트, LCU 결과·타임라인, 채팅 OCR·로그, 롤 경기 상세 | ✅ 완료 (Windows 실기 확인: [기록](docs/dev/test-results.md)) · v1.3.3 에서 OCR 은 빼고 LCU API · 로그 파일만 씀 | | M5 exe · 설정 · 모델 | 포터블 exe, 첫 실행 마법사, GPU 감지·모델 다운로드, 암호화 저장, 7일 삭제 | ✅ 완료 (Windows 빌드·실행 확인) | | M6 단어사전 · UI/UX | 핫워드·교정 사전, 사이트 교정 반영, 테마·애니메이션·효과음 | ✅ 완료 ([사전 효과](docs/dev/test-results.md)) | | M7 실사용 테스트 | 통합 테스트, 성능·안정화 | ✅ 완료 (GPU 실음성: CER 3.6%, 지연 1.05초 · [기록](docs/dev/test-results.md)) | @@ -70,7 +77,7 @@ ``` app/ 게임 PC 앱 (Electron + Node.js 코어, TypeScript) -worker/ STT 워커 (Python, faster-whisper, OCR, 모델 관리, 파인튜닝) +worker/ STT 워커 (Python, faster-whisper, 롤 로그 채팅, 모델 관리, 파인튜닝) site/server/ 사이트 서버 (Fastify, Discord OAuth2, 기기 중계) site/web/ 사이트 화면 (React + Vite) packages/shared/ 앱·사이트 공통 타입 @@ -94,5 +101,5 @@ deploy/site/deploy.sh # .5 배포 (deploy/README.md) # 앱 코어 (헤드리스) cd app && npm install && npm test -npm run core -- --diagnose # 게임 PC 진단 (GPU·STT 속도·Riot API·OCR) +npm run core -- --diagnose # 게임 PC 진단 (GPU·STT 속도·Riot API·롤 로그 채팅) ``` diff --git a/app/package-lock.json b/app/package-lock.json index dfbc9cc..c56755e 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "gvr-app", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gvr-app", - "version": "1.3.2", + "version": "1.3.3", "license": "UNLICENSED", "dependencies": { "@discordjs/voice": "^0.19.2", diff --git a/app/package.json b/app/package.json index ba86fc6..5f5e9ff 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "gvr-app", "productName": "겜녹이", - "version": "1.3.2", + "version": "1.3.3", "description": "겜녹이 (Game Voice Recorder) - 게임 연동 디스코드 음성 기록", "private": true, "main": "dist/main.cjs", @@ -110,4 +110,4 @@ "unpackDirName": "GameVoiceRecorder" } } -} \ No newline at end of file +} diff --git a/app/resources/diag/lol-chat-sample.png b/app/resources/diag/lol-chat-sample.png deleted file mode 100644 index a6398cd..0000000 Binary files a/app/resources/diag/lol-chat-sample.png and /dev/null differ diff --git a/app/scripts/culprit-real-e2e.mts b/app/scripts/culprit-real-e2e.mts index f8ca3f8..4167421 100644 --- a/app/scripts/culprit-real-e2e.mts +++ b/app/scripts/culprit-real-e2e.mts @@ -24,7 +24,7 @@ const LS = Date.now() - 80 * MIN; const lol = makeDemoLol(); const lolId = 'lol-demo'; core.store.setMeta('riot_self_puuid', 'l-sh'); -core.store.setAccounts('u1', [{ puuid: 'p-sh', riotId: '승한#V' }, { puuid: 'l-sh', riotId: '승한#L' }]); +core.store.setAccounts('u1', [{ puuid: 'p-sh', riotId: '하늘#V' }, { puuid: 'l-sh', riotId: '하늘#L' }]); core.store.setAccounts('u2', [{ puuid: 'p-ms', riotId: '민수#V' }, { puuid: 'l-ms', riotId: '민수#L' }]); core.store.startSession('s-lol', 'g', 'c', '음성', LS - MIN); core.games.matchStarted({ id: lolId, game: 'lol', startedAt: LS, map: 'Map11', mode: 'CLASSIC', queue: '420', detail: { live: true } }); @@ -66,7 +66,7 @@ const { RelayClient } = await import('../src/core/relay/client.ts'); const rc = new RelayClient(local as any, core.bus, () => ({ serverUrl: base, deviceId: reg.deviceId, deviceKey: reg.deviceKey, name: 'GAME-PC', version: 't', guildId: 'g' })); rc.start(); while (!site.hub.status().online) await new Promise((r) => setTimeout(r, 100)); -const sess = site.store.createSession({ id: 'u1', name: '승한', avatar: null }); +const sess = site.store.createSession({ id: 'u1', name: '하늘', avatar: null }); const cookieHeader = `gvr_sid=${encodeURIComponent(site.app.signCookie(sess.token))}`; const stages: Record = {}; diff --git a/app/scripts/culprit-shots.mts b/app/scripts/culprit-shots.mts index 902298f..26ae336 100644 --- a/app/scripts/culprit-shots.mts +++ b/app/scripts/culprit-shots.mts @@ -18,7 +18,7 @@ const { id: valId } = seedValorant(core); const LS = Date.now() - 80 * MIN; const lol = makeDemoLol(); core.store.setMeta('riot_self_puuid', 'l-sh'); -core.store.setAccounts('u1', [{ puuid: 'p-sh', riotId: '승한#V' }, { puuid: 'l-sh', riotId: '승한#L' }]); +core.store.setAccounts('u1', [{ puuid: 'p-sh', riotId: '하늘#V' }, { puuid: 'l-sh', riotId: '하늘#L' }]); core.store.setAccounts('u2', [{ puuid: 'p-ms', riotId: '민수#V' }, { puuid: 'l-ms', riotId: '민수#L' }]); core.store.startSession('s2', 'g', 'c', '음성', LS - MIN); core.games.matchStarted({ id: 'lol-demo', game: 'lol', startedAt: LS, map: 'Map11', mode: 'CLASSIC', queue: '420', detail: { live: true } }); @@ -78,7 +78,7 @@ const rc = new RelayClient(local as any, core.bus, () => ({ serverUrl: base, dev rc.start(); // 사이트 화면은 /api/overview · /api/users 도 부른다 while (!site.hub.status().online) await new Promise((r) => setTimeout(r, 100)); -const sess = site.store.createSession({ id: 'u1', name: '승한', avatar: null }); +const sess = site.store.createSession({ id: 'u1', name: '하늘', avatar: null }); const cookie = { name: 'gvr_sid', value: site.app.signCookie(sess.token), url: base }; const puppeteer = (await import(path.join(os.homedir(), '.tmp/gvr-shot/node_modules/puppeteer-core/lib/esm/puppeteer/puppeteer-core.js'))).default; diff --git a/app/scripts/demo-stack.mts b/app/scripts/demo-stack.mts index 21c9902..506b92a 100644 --- a/app/scripts/demo-stack.mts +++ b/app/scripts/demo-stack.mts @@ -24,7 +24,7 @@ fs.symlinkSync(path.join(hf, fs.readdirSync(hf)[0]), path.join(work, 'models', m fs.writeFileSync(path.join(work, 'settings.json'), JSON.stringify({ stt: { realtimeModel: model, preciseModel: model, device: 'cpu', computeType: 'int8' }, games: { valorant: false, lol: false } })); const USERS = [ - { id: '100000000000000001', name: '승한', voice: 'ko-KR-InJoonNeural', val: 'p-sh', lol: 'l-sh' }, + { id: '100000000000000001', name: '하늘', voice: 'ko-KR-InJoonNeural', val: 'p-sh', lol: 'l-sh' }, { id: '100000000000000002', name: '민수', voice: 'ko-KR-HyunsuMultilingualNeural', val: 'p-ms', lol: 'l-ms' }, { id: '100000000000000003', name: '지우', voice: 'ko-KR-SunHiNeural', val: 'p-jw', lol: 'l-jw' }, { id: '100000000000000004', name: '현우', voice: 'ko-KR-InJoonNeural', pitch: '-8Hz', val: 'p-hw', lol: 'l-hw' }, @@ -136,8 +136,8 @@ LINES.forEach((l, i) => { }); for (const [m, name, ch, text, src] of [ [-1.5, '민수', 'team', '정글 갱 갈게요', 'lcu'], - [5.2, 'Lumi', 'all', '아리 잘하네', 'ocr'], - [11.4, '지우', 'team', '드래곤 가자', 'ocr'], + [5.2, 'Lumi', 'all', '아리 잘하네', 'log'], + [11.4, '지우', 'team', '드래곤 가자', 'log'], [28.5, 'Kiwi', 'all', 'gg', 'lcu'], ] as const) { games.event({ id: `${lolId}:chat:demo${m}`, match_id: lolId, game: 'lol', type: 'chat', ts: LS + m * 60_000, game_time_ms: m * 60_000, round: null, actor_puuid: null, target_puuid: null, data: JSON.stringify({ sender: { name }, channel: ch, text, source: src }) }); @@ -200,7 +200,7 @@ const reg = await registerDevice(base, code.code, 'GAME-PC'); core.settings.update({ site: { serverUrl: base, deviceId: reg.deviceId, deviceName: 'GAME-PC' } }); core.settings.setSecret('deviceKey', reg.deviceKey); core.relay.restart(); -const sess = site.store.createSession({ id: USERS[0].id, name: '승한', avatar: null }); +const sess = site.store.createSession({ id: USERS[0].id, name: '하늘', avatar: null }); const cookie = { name: 'gvr_sid', value: site.app.signCookie(sess.token), url: base }; while (core.relay.status.state !== 'online') await new Promise((r) => setTimeout(r, 100)); console.log(`사이트: ${base} (쿠키 gvr_sid=${cookie.value})`); diff --git a/app/src/core/auth.ts b/app/src/core/auth.ts index 0bbf82a..bb767d0 100644 --- a/app/src/core/auth.ts +++ b/app/src/core/auth.ts @@ -203,6 +203,21 @@ export class AppAuth extends EventEmitter { if (token) await this.call('POST', '/auth/app/logout', {}, token).catch(() => undefined); } + /** 관리자 · 최고 관리자 아이디 (따라갈 사람 목록 정렬용) */ + async adminIds(): Promise { + const r = await this.call<{ ids: string[] }>('GET', '/app/admins'); + return Array.isArray(r?.ids) ? r.ids : []; + } + + /** 표시 이름 (실명 숨기기): 디스코드 아이디 → 이름 */ + async displayNames(): Promise> { + const r = await this.call<{ names: Record }>('GET', '/app/names'); + return r?.names && typeof r.names === 'object' ? r.names : {}; + } + adminSetDisplayName(id: string, name: string): Promise<{ names: Record }> { + return this.call('PUT', '/app/admin/names', { id: id.trim(), name: name.trim() }); + } + // ---- 관리자 화면 (서버가 역할을 다시 확인한다) adminUsers(): Promise<{ users: AppUserRow[] }> { return this.call('GET', '/app/admin/users'); diff --git a/app/src/core/db/db.ts b/app/src/core/db/db.ts index 39eba2e..63eb345 100644 --- a/app/src/core/db/db.ts +++ b/app/src/core/db/db.ts @@ -125,9 +125,49 @@ export class Store { `INSERT INTO users(id,name,color,avatar,updated_at) VALUES(?,?,?,?,?) ON CONFLICT(id) DO UPDATE SET name=excluded.name, avatar=excluded.avatar, updated_at=excluded.updated_at`, ) - .run(u.id, u.name, colorFor(u.id), u.avatar, now); + .run(u.id, this.displayNames()[u.id] ?? u.name, colorFor(u.id), u.avatar, now); return this.getUser(u.id)!; } + + // 표시 이름 (실명 숨기기): 사이트 서버에 정해 둔 이름을 디스코드 이름 대신 저장한다 + private names: Record | null = null; + displayNames(): Record { + if (!this.names) { + try { + this.names = JSON.parse(this.meta('display_names') || '{}'); + } catch { + this.names = {}; + } + } + return this.names!; + } + /** 새 표시 이름을 저장하고, 이미 저장된 유저 이름 · 지난 범인 분석에 남은 예전 이름도 바꾼다 */ + setDisplayNames(map: Record): void { + const names: Record = {}; + for (const [id, name] of Object.entries(map)) if (typeof name === 'string' && name.trim()) names[id] = name.trim(); + this.names = names; + this.setMeta('display_names', JSON.stringify(names)); + const culprit = !!this.db.prepare(`SELECT 1 FROM sqlite_master WHERE type='table' AND name='culprit_analyses'`).get(); + const j = (x: string) => JSON.stringify(x).slice(1, -1); + this.db.transaction(() => { + for (const [id, name] of Object.entries(names)) { + const u = this.getUser(id); + if (!u || u.name === name) continue; + this.db.prepare('UPDATE users SET name=? WHERE id=?').run(name, id); + if (culprit && u.name.length >= 2) this.db.prepare('UPDATE culprit_analyses SET result=replace(result,?,?)').run(j(u.name), j(name)); + } + if (!culprit) return; + for (const r of this.db.prepare('SELECT id, created_by FROM culprit_analyses').all() as { id: string; created_by: string }[]) { + let by: any; + try { + by = JSON.parse(r.created_by); + } catch { + continue; + } + if (by?.id && names[by.id] && by.name !== names[by.id]) this.db.prepare('UPDATE culprit_analyses SET created_by=? WHERE id=?').run(JSON.stringify({ ...by, name: names[by.id] }), r.id); + } + })(); + } getUser(id: string): UserRow | undefined { return this.db.prepare('SELECT * FROM users WHERE id=?').get(id) as UserRow | undefined; } diff --git a/app/src/core/diagnostics.ts b/app/src/core/diagnostics.ts index ac37de7..8e43e75 100644 --- a/app/src/core/diagnostics.ts +++ b/app/src/core/diagnostics.ts @@ -128,24 +128,13 @@ export async function runDiagnostics(opts: { }); } - // 5. 채팅 OCR (한국어 OCR 설치 여부 + 정확도) - try { - const r = await opts.worker.request('ocr_image', { path: path.join(opts.resourcesDir, 'diag', 'lol-chat-sample.png'), lang: 'ko' }, 60000); - const lines: string[] = (r.lines || []).map((l: any) => l.text ?? l); - const expect = ['드래곤 가자', 'gg', '바텀 갱 간다']; - const hit = expect.filter((e) => lines.some((l) => l.replace(/\s/g, '').includes(e.replace(/\s/g, '')))).length; - add({ id: 'ocr', label: '채팅 OCR (한국어)', ok: hit >= 2, detail: `예시 3줄 중 ${hit}줄 인식: ${lines.join(' / ')}`, data: r }); - } catch (e: any) { - add({ id: 'ocr', label: '채팅 OCR (한국어)', ok: false, detail: e.message }); - } - - // 6. r3dlog 채팅 + // 5. r3dlog 채팅 (롤은 게임 중 채팅 API 가 없어 로그 파일에 남을 때만 쓴다) const logs = opts.lolLogsDir || (lcu?.installDir ? path.join(lcu.installDir, 'Logs', 'GameLogs') : null); if (!logs || !fs.existsSync(logs)) add({ id: 'r3dlog', label: '롤 로그 파일 채팅', ok: null, detail: '로그 폴더를 찾지 못했습니다 (롤을 한 판 한 뒤 확인)' }); else { try { const r = await opts.worker.request('r3dlog_check', { logs_dir: logs }, 30000); - add({ id: 'r3dlog', label: '롤 로그 파일 채팅', ok: r.found_chat, detail: r.found_chat ? `채팅이 남아 있음 → OCR 대신 사용 (${r.file})` : '로그에 채팅이 없음 → 화면 OCR 사용', data: r }); + add({ id: 'r3dlog', label: '롤 로그 파일 채팅', ok: r.found_chat ? true : null, detail: r.found_chat ? `채팅이 남아 있음 → 게임 중 채팅을 경기 뒤에 붙임 (${r.file})` : '로그에 채팅이 없음 → 게임 중 전체 · 팀 채팅은 기록되지 않음 (챔피언 선택 · 게임 후 채팅은 LCU 로 기록)', data: r }); } catch (e: any) { add({ id: 'r3dlog', label: '롤 로그 파일 채팅', ok: false, detail: e.message }); } diff --git a/app/src/core/games/lol.ts b/app/src/core/games/lol.ts index 07992cd..74c9876 100644 --- a/app/src/core/games/lol.ts +++ b/app/src/core/games/lol.ts @@ -47,7 +47,8 @@ const DRAGON_KO: Record = { * 리그 오브 레전드 어댑터 (보고서 6-5). * - 게임 클라이언트 API(127.0.0.1:2999): 게임 시간, 10명 KDA·CS·아이템, 킬·오브젝트 이벤트 * - 롤 클라이언트(LCU): 경기 ID·결과·경기 기록(타임라인), 챔피언 선택·게임 후 채팅 - * - 게임 중 채팅: 화면 OCR (STT 워커) 또는 로그 파일(남아 있을 때) + * - 게임 중 전체 · 팀 채팅: 롤은 이걸 주는 API 가 없다 (LCU · 게임 클라이언트 API 모두). 화면 글자 인식(OCR)은 쓰지 않고, + * 게임 로그 파일(r3dlog)에 채팅이 남아 있을 때만 경기 뒤에 읽는다 */ export class LolAdapter implements GameAdapter { readonly game = 'lol' as const; @@ -61,15 +62,10 @@ export class LolAdapter implements GameAdapter { private pendingChat: EventRow[] = []; private detailQueue = new Map(); private summonerNames = new Map(); - private ocrSeen = new Set(); private lastMatchId: string | null = null; private lastErr = ''; - constructor(private host: AdapterHost) { - host.worker.on('event', (ev: any) => { - if (ev.event === 'ocr_line') this.onOcrLine(ev); - }); - } + constructor(private host: AdapterHost) {} start(): void { if (this.timer) return; @@ -80,7 +76,6 @@ export class LolAdapter implements GameAdapter { if (this.timer) clearInterval(this.timer); if (this.lcuTimer) clearInterval(this.lcuTimer); this.timer = this.lcuTimer = null; - if (this.live) void this.host.worker.request('ocr_stop', {}, 5000).catch(() => undefined); } status() { return { connected: !!this.lcu || !!this.live, inMatch: !!this.live && !this.live.ended, detail: this.lastErr || undefined }; @@ -148,7 +143,6 @@ export class LolAdapter implements GameAdapter { ended: false, }; this.lastMatchId = id; - this.ocrSeen.clear(); this.host.matchStarted({ id, game: 'lol', @@ -161,7 +155,6 @@ export class LolAdapter implements GameAdapter { // 버퍼해 둔 챔피언 선택 채팅을 이 경기에 붙인다 for (const e of this.pendingChat) this.host.event({ ...e, match_id: id, id: `${id}:${e.id}` }); this.pendingChat = []; - void this.startOcr(); log.info(`롤 경기 시작 감지 ${id}`); } const m = this.live; @@ -307,7 +300,6 @@ export class LolAdapter implements GameAdapter { if (!m || m.ended) return; m.ended = true; const now = Date.now(); - void this.host.worker.request('ocr_stop', {}, 5000).catch(() => undefined); this.host.matchEnded(m.id, now); this.host.matchUpdated(m.id, { result: JSON.stringify({ win, score: null }), @@ -323,19 +315,7 @@ export class LolAdapter implements GameAdapter { }, 60000).unref(); } - // ------------------------------------------------------------------ 채팅 OCR · 로그 - private async startOcr(): Promise { - const s = this.host.settings().games; - if (!s.lolChatOcr || process.platform !== 'win32') return; - try { - await this.host.worker.request('ocr_start', { window_title: 'League of Legends (TM) Client', region: s.lolOcrRegion, fps: 3, lang: 'ko' }, 15000); - log.info('롤 채팅 OCR 시작'); - } catch (e: any) { - this.lastErr = `채팅 OCR: ${e.message}`; - log.warn('채팅 OCR 시작 실패', e); - } - } - + // ------------------------------------------------------------------ 게임 중 채팅 (로그 파일) private chatRow(m: LiveMatch, key: string, gameTimeS: number | null, ts: number, p: any, source: ChatData['source']): EventRow { const sender = this.findPlayer(m, p.sender); const ts2 = gameTimeS !== null ? m.startedAt + gameTimeS * 1000 : ts; @@ -363,18 +343,7 @@ export class LolAdapter implements GameAdapter { }; } - private onOcrLine(ev: any): void { - const m = this.live; - if (!m || m.ended || !ev.parsed?.message) return; - const p = ev.parsed; - const key = `${p.game_time ?? ''}|${p.sender ?? ''}|${p.message}`; - if (this.ocrSeen.has(key)) return; - this.ocrSeen.add(key); - const gts = typeof p.game_time_s === 'number' ? p.game_time_s : null; - this.host.event(this.chatRow(m, hash(key), gts, ev.ts || Date.now(), p, 'ocr')); - } - - /** 로그 파일에 채팅이 남아 있으면 OCR 보다 정확하므로 그걸로 바꾼다 */ + /** 경기가 끝나면 로그 파일에 남은 게임 중 채팅을 붙인다 (LCU 로 받은 챔피언 선택 · 게임 후 채팅은 그대로 둔다) */ private async readLogChat(m: LiveMatch): Promise { const dir = this.host.settings().games.lolLogsDir || (this.lcu?.installDir ? `${this.lcu.installDir}\\Logs\\GameLogs` : null); if (!dir) return; @@ -385,8 +354,8 @@ export class LolAdapter implements GameAdapter { const rows = lines.map((p: any, i: number) => this.chatRow(m, `${i}-${hash(`${p.game_time_s}|${p.sender}|${p.message}`)}`, typeof p.game_time_s === 'number' ? p.game_time_s : null, m.startedAt, p, 'log'), ); - this.host.replaceEvents(m.id, ['chat'], rows); - log.info(`로그 파일 채팅 ${rows.length}줄로 교체`); + for (const row of rows) this.host.event(row); + log.info(`로그 파일 채팅 ${rows.length}줄`); } catch (e) { log.debug('로그 파일 채팅 없음', e); } diff --git a/app/src/core/index.ts b/app/src/core/index.ts index 923b981..1a1308b 100644 --- a/app/src/core/index.ts +++ b/app/src/core/index.ts @@ -145,8 +145,20 @@ export async function startCore(opts: CoreOptions) { }; await startBot(); + // 녹음할 서버를 바꾸면 봇을 다시 붙여 새 서버를 지켜본다 (이전 서버의 녹음은 끝난다) + let watchedGuild = S().discord.guildId; + const offGuild = settings.onChange((s) => { + const g = s.discord.guildId; + if (g === watchedGuild) return; + watchedGuild = g; + if (bot.state.status !== 'ready' || !g || bot.state.guild?.id === g) return; + log.info('녹음할 서버가 바뀌어 봇을 다시 연결합니다'); + void bot.stop().then(startBot); + }); + const stop = async () => { log.info('종료 중'); + offGuild(); relay.stop(); retention.stop(); games.stop(); diff --git a/app/src/core/settings.ts b/app/src/core/settings.ts index 9234cd2..ec71553 100644 --- a/app/src/core/settings.ts +++ b/app/src/core/settings.ts @@ -21,8 +21,6 @@ export interface Settings { games: { valorant: boolean; lol: boolean; - lolChatOcr: boolean; - lolOcrRegion: { x: number; y: number; w: number; h: number }; lolLogsDir: string | null; }; stt: { @@ -100,8 +98,6 @@ export function defaultSettings(): Settings { games: { valorant: true, lol: true, - lolChatOcr: true, - lolOcrRegion: { x: 0.0, y: 0.6, w: 0.3, h: 0.27 }, lolLogsDir: null, }, stt: { diff --git a/app/src/main/api-types.ts b/app/src/main/api-types.ts index 65a193a..c4af119 100644 --- a/app/src/main/api-types.ts +++ b/app/src/main/api-types.ts @@ -82,13 +82,15 @@ export interface GvrApi { adminAddUser(id: string, role: 'admin' | 'user'): Promise<{ users: AppUserRow[] }>; adminSetRole(id: string, role: 'admin' | 'user'): Promise<{ users: AppUserRow[] }>; adminRemoveUser(id: string): Promise<{ users: AppUserRow[] }>; + adminDisplayNames(): Promise>; + adminSetDisplayName(id: string, name: string): Promise>; getState(): Promise; onState(cb: (s: AppState) => void): () => void; updateSettings(patch: DeepPartial): Promise; setSecret(key: 'botToken' | 'riotApiKey', value: string | null): Promise; testBotToken(token?: string): Promise<{ ok: boolean; bot?: { id: string; name: string; avatar: string | null }; guilds?: { id: string; name: string }[]; error?: string }>; restartBot(): Promise<{ ok: boolean; error?: string }>; - guildMembers(): Promise<{ id: string; name: string; avatar: string | null; bot: boolean }[]>; + guildMembers(): Promise<{ id: string; name: string; avatar: string | null; bot: boolean; me: boolean; admin: boolean }[]>; previewTts(text: string, voice: string): Promise<{ ok: boolean; dataUrl?: string; error?: string }>; gpuInfo(): Promise; models(): Promise; diff --git a/app/src/main/ipc.ts b/app/src/main/ipc.ts index e74a206..88b9312 100644 --- a/app/src/main/ipc.ts +++ b/app/src/main/ipc.ts @@ -122,9 +122,14 @@ export function registerIpc(ctx: IpcContext) { await core.startBot(); return core.bot.state.status === 'ready' || core.bot.state.status === 'connecting' ? { ok: true } : { ok: false, error: core.bot.state.error ?? '봇을 시작하지 못했습니다' }; }, + // 따라갈 사람 목록: 내 계정 → 관리자 → 나머지(이름순). 실패하면 오류를 그대로 보여 준다 guildMembers: async () => { - const ms = await core.bot.members().catch(() => []); - return ms.map((m) => ({ id: m.id, name: m.name, avatar: m.avatar, bot: m.bot })).sort((a, b) => a.name.localeCompare(b.name, 'ko')); + const [ms, admins] = await Promise.all([core.bot.members(), ctx.auth.adminIds().catch(() => [] as string[])]); + const meId = ctx.auth.state.user?.id ?? null; + const rank = (m: { me: boolean; admin: boolean }) => (m.me ? 0 : m.admin ? 1 : 2); + return ms + .map((m) => ({ id: m.id, name: core.store.displayNames()[m.id] ?? m.name, avatar: m.avatar, bot: m.bot, me: m.id === meId, admin: admins.includes(m.id) })) + .sort((a, b) => rank(a) - rank(b) || a.name.localeCompare(b.name, 'ko')); }, previewTts: async (text: string, voice: string) => { try { @@ -343,6 +348,13 @@ export function registerIpc(ctx: IpcContext) { adminAddUser: (id: string, r: 'admin' | 'user') => ctx.auth.adminAddUser(id, r), adminSetRole: (id: string, r: 'admin' | 'user') => ctx.auth.adminSetRole(id, r), adminRemoveUser: (id: string) => ctx.auth.adminRemoveUser(id), + adminDisplayNames: () => ctx.auth.displayNames(), + adminSetDisplayName: async (id: string, name: string) => { + if (role() !== 'superadmin') throw new Error('표시 이름은 최고 관리자만 바꿀 수 있습니다'); + const r = await ctx.auth.adminSetDisplayName(id, name); + ctx.current()?.core.store.setDisplayNames(r.names); + return r.names; + }, openExternal: h.openExternal, quit: h.quit, }; diff --git a/app/src/main/main.ts b/app/src/main/main.ts index 6452b23..8d5124c 100644 --- a/app/src/main/main.ts +++ b/app/src/main/main.ts @@ -228,6 +228,18 @@ const refreshShell = () => { let starting: Promise | null = null; +/** 표시 이름(실명 숨기기)을 사이트 서버에서 받아 녹음 기록 · 범인 분석에 반영한다 (못 받으면 저장해 둔 것을 그대로 쓴다) */ +async function syncNames(): Promise { + const c = core; + if (!c || !auth?.ok) return; + try { + const names = await auth.displayNames(); + if (core === c) c.store.setDisplayNames(names); + } catch (e: any) { + log.warn(`표시 이름을 받지 못했습니다: ${e?.message ?? e}`); + } +} + /** 로그인 확인 후 코어 시작 */ function startApp(): Promise { if (core) return Promise.resolve(); @@ -236,6 +248,7 @@ function startApp(): Promise { // 겜녹이 봇 중계가 로그인 만료 · 등록 해제를 알려 오면 10분을 기다리지 않고 바로 확인해서 잠근다 const c = await startCore({ dataDir, resourcesDir: resourcesDir(), worker: workerCommand(), version: app.getVersion(), settings: settings!, onBotUnauthorized: () => void auth?.check() }); core = c; + void syncNames(); ft = new Finetuner(c, pushState); ft.scheduleNightly(); appError = null; @@ -315,7 +328,7 @@ app.whenReady().then(async () => { const st = a.state.status; if ((st === 'ok' && Date.now() - lastCheck > 10 * 60000) || (st === 'error' && Date.now() - lastCheck > 60000) || (st === 'ok' && a.state.offline && Date.now() - lastCheck > 60000)) { lastCheck = Date.now(); - void a.check(); + void a.check().then(syncNames); } }, 15000); setInterval(() => { diff --git a/app/src/main/preload.ts b/app/src/main/preload.ts index 66ae7cb..86dfef8 100644 --- a/app/src/main/preload.ts +++ b/app/src/main/preload.ts @@ -7,7 +7,7 @@ const METHODS = [ 'runRetention', 'users', 'setRiotIds', 'setExcluded', 'dictionary', 'addWord', 'addCorrection', 'deleteDict', 'setDictEnabled', 'finetuneStatus', 'finetuneInstall', 'finetuneStart', 'finetuneStop', 'finetuneRollback', 'clearTrainingData', 'openExternal', 'openPath', 'setAutoStart', 'finishWizard', 'recentLogs', 'quit', - 'authState', 'authLogin', 'authCancel', 'authLogout', 'authRecheck', 'adminUsers', 'adminAddUser', 'adminSetRole', 'adminRemoveUser', + 'authState', 'authLogin', 'authCancel', 'authLogout', 'authRecheck', 'adminUsers', 'adminAddUser', 'adminSetRole', 'adminRemoveUser', 'adminDisplayNames', 'adminSetDisplayName', ]; const api: Record = {}; for (const m of METHODS) api[m] = (...args: unknown[]) => ipcRenderer.invoke(`gvr:${m}`, ...args); diff --git a/app/src/renderer/mock-gvr.ts b/app/src/renderer/mock-gvr.ts index 700d12a..16a8826 100644 --- a/app/src/renderer/mock-gvr.ts +++ b/app/src/renderer/mock-gvr.ts @@ -25,7 +25,7 @@ function defaults(): Settings { ttsOnNewMember: true, ttsVoice: 'ko-KR-SunHiNeural', }, - games: { valorant: true, lol: true, lolChatOcr: true, lolOcrRegion: { x: 0.0, y: 0.6, w: 0.3, h: 0.27 }, lolLogsDir: null }, + games: { valorant: true, lol: true, lolLogsDir: null }, stt: { realtimeModel: 'large-v3-turbo', preciseModel: 'large-v3', @@ -111,6 +111,7 @@ export function createMockGvr(): GvrApi { }; const authListeners = new Set<(s: AuthView) => void>(); const emitAuth = () => authListeners.forEach((l) => l(structuredClone(auth))); + const displayNames: Record = { '100000000000000003': '지호' }; let adminRows: AppUserRow[] = [ { id: '293719842274541579', name: '사금향', avatar: null, role: 'superadmin', fixed: true, addedBy: null, addedAt: null, lastSeenAt: now - 60000, lastVersion: '1.2.0' }, { id: '1352267557213573160', name: '두번째관리자', avatar: null, role: 'superadmin', fixed: true, addedBy: null, addedAt: null, lastSeenAt: now - 3 * 86400000, lastVersion: '1.2.0' }, @@ -292,6 +293,17 @@ export function createMockGvr(): GvrApi { adminRows = adminRows.map((u) => (u.id === id && !u.fixed ? { ...u, role: r } : u)); return { users: structuredClone(adminRows) }; }, + async adminDisplayNames() { + await sleep(150); + return { ...displayNames }; + }, + async adminSetDisplayName(id, name) { + await sleep(150); + adminCheck('superadmin'); + if (name.trim()) displayNames[id] = name.trim(); + else delete displayNames[id]; + return { ...displayNames }; + }, async adminRemoveUser(id) { await sleep(200); adminCheck('superadmin'); @@ -357,12 +369,12 @@ export function createMockGvr(): GvrApi { async guildMembers() { await sleep(300); return [ - { id: 'u1', name: '민준', avatar: null, bot: false }, - { id: 'u2', name: '서연', avatar: null, bot: false }, - { id: 'u3', name: '지호', avatar: null, bot: false }, - { id: 'u4', name: '현우', avatar: null, bot: false }, - { id: 'b1', name: '겜녹이', avatar: null, bot: true }, - { id: 'b2', name: 'MEE6', avatar: null, bot: true }, + { id: 'u1', name: '민준', avatar: null, bot: false, me: true, admin: true }, + { id: 'u3', name: '지호', avatar: null, bot: false, me: false, admin: true }, + { id: 'u2', name: '서연', avatar: null, bot: false, me: false, admin: false }, + { id: 'u4', name: '현우', avatar: null, bot: false, me: false, admin: false }, + { id: 'b1', name: '겜녹이', avatar: null, bot: true, me: false, admin: false }, + { id: 'b2', name: 'MEE6', avatar: null, bot: true, me: false, admin: false }, ]; }, async previewTts() { @@ -462,7 +474,6 @@ export function createMockGvr(): GvrApi { { id: 'tts', label: 'TTS 안내 음성', ok: true, detail: 'Edge TTS 응답 0.6초' }, { id: 'valorant', label: '발로란트 로컬 API', ok: true, detail: 'Riot Client 연결됨 (lockfile)' }, { id: 'lol', label: '롤 Live Client API', ok: null, detail: '게임이 꺼져 있어 확인할 수 없습니다' }, - { id: 'ocr', label: '롤 채팅 OCR', ok: null, detail: '게임이 꺼져 있어 확인할 수 없습니다' }, { id: 'relay', label: '사이트 서버', ok: state.relay.state === 'online', detail: state.relay.state === 'online' ? 'gvr.tkrmagid.kr 연결됨 · 왕복 38ms' : '등록되지 않음' }, { id: 'disk', label: '저장 공간', ok: true, detail: 'D: 여유 412GB' }, ]; diff --git a/app/src/renderer/styles.css b/app/src/renderer/styles.css index b6893d7..2c4cb15 100644 --- a/app/src/renderer/styles.css +++ b/app/src/renderer/styles.css @@ -178,8 +178,6 @@ input[type='number'].input { flex: none; padding: 7px 8px; } .game.lol.on { border: 2px solid var(--lol); background: linear-gradient(160deg, #241e13, var(--panel) 60%); padding: 15px 17px; } .game.lol .game-name { color: var(--lol); } .game.lol .tg.on { background: linear-gradient(180deg, #c8aa6e, #9a7b45); } -.region { display: flex; gap: 10px; } -.region label { display: flex; align-items: center; gap: 5px; } /* 표 */ .table { width: 100%; border-collapse: collapse; font-size: 13px; } diff --git a/app/src/renderer/tabs/AdminTab.tsx b/app/src/renderer/tabs/AdminTab.tsx index 97150c2..802f0b4 100644 --- a/app/src/renderer/tabs/AdminTab.tsx +++ b/app/src/renderer/tabs/AdminTab.tsx @@ -150,6 +150,66 @@ function UserTable({ users, superAdmin, onChange }: { users: AppUserRow[]; super ); } +/** 표시 이름: 실명이 들어간 디스코드 이름 · 서버 별명 대신 사이트 · 녹음 기록 · 범인 분석에 쓸 이름 */ +function DisplayNames({ superAdmin }: { superAdmin: boolean }) { + const { toast } = useApp(); + const list = useLoad(() => gvr.adminDisplayNames()); + const [id, setId] = useState(''); + const [name, setName] = useState(''); + const act = useAction(); + const valid = /^\d{17,20}$/.test(id.trim()) && !!name.trim(); + const save = async (uid: string, n: string) => { + const r = await act.run(() => gvr.adminSetDisplayName(uid, n)); + if (r) { + list.setData(r); + toast(n ? `${uid} → ${n}` : `${uid} 표시 이름 지움`); + setId(''); + setName(''); + } + }; + const rows = Object.entries(list.data ?? {}); + return ( + <> + {superAdmin && ( +
+ setId(e.target.value.replace(/\s/g, ''))} /> + setName(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && valid && void save(id.trim(), name.trim())} /> + save(id.trim(), name.trim())}> + 저장 + +
+ )} + {list.loading && !list.data ? ( + + ) : list.error ? ( + {list.error} + ) : rows.length ? ( + + + {rows.map(([uid, n]) => ( + + + + {superAdmin && ( + + )} + + ))} + +
{uid}{n} + save(uid, '')}> + 지우기 + +
+ ) : ( +
정해 둔 표시 이름이 없습니다. 디스코드 이름(서버 별명)이 그대로 보입니다.
+ )} +
디스코드 이름이나 서버 별명에 실명이 들어 있으면 여기서 다른 이름을 정해 주세요. 사이트, 녹음 기록, 범인 분석에 이 이름만 쓰고 이미 저장된 기록의 이름도 바꿉니다.
+ {act.error} + + ); +} + export function AdminTab() { const { state } = useApp(); const superAdmin = state.account.role === 'superadmin'; @@ -179,6 +239,9 @@ export function AdminTab() { > {list.loading && !list.data ? : list.error ? {list.error} : } +
+ +
    {ADMIN_FEATURES.map((f) => ( diff --git a/app/src/renderer/tabs/DiscordTab.tsx b/app/src/renderer/tabs/DiscordTab.tsx index 4ae9e1f..e1eed62 100644 --- a/app/src/renderer/tabs/DiscordTab.tsx +++ b/app/src/renderer/tabs/DiscordTab.tsx @@ -220,13 +220,20 @@ export function GuildFollow({ guilds, compact }: { guilds?: { id: string; name: disabled={!d.guildId || members.loading} options={[ { value: '', label: members.loading && d.guildId ? '불러오는 중…' : '선택 안 함' }, - ...people.map((m) => ({ value: m.id, label: m.name })), + ...people.map((m) => ({ value: m.id, label: m.me ? `${m.name} (나)` : m.admin ? `${m.name} · 관리자` : m.name })), ...(d.followUserId && !people.some((p) => p.id === d.followUserId) && !members.loading ? [{ value: d.followUserId, label: `(알 수 없음 ${d.followUserId})` }] : []), ]} onChange={(v) => save({ discord: { followUserId: v || null } })} /> - {members.error && {members.error}} + {members.error && ( + + 멤버 목록을 불러오지 못했습니다: {members.error}{' '} + void members.reload()}> + 다시 불러오기 + + + )} ); } diff --git a/app/src/renderer/tabs/GamesTab.tsx b/app/src/renderer/tabs/GamesTab.tsx index 1554100..17ab10a 100644 --- a/app/src/renderer/tabs/GamesTab.tsx +++ b/app/src/renderer/tabs/GamesTab.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import type { User } from '@gvr/shared'; import { gvr, useAction, useApp, useLoad } from '../store'; -import { Avatar, Btn, Dot, Err, FolderRow, Line, NumInput, Page, Section, Spinner, Toggle, ToggleLine } from '../ui'; +import { Avatar, Btn, Dot, Err, FolderRow, Page, Section, Spinner, Toggle } from '../ui'; /** 발로란트 / 롤 켜기 카드 (마법사에서도 사용) */ export function GameCards({ showStatus = true }: { showStatus?: boolean }) { @@ -9,7 +9,7 @@ export function GameCards({ showStatus = true }: { showStatus?: boolean }) { const g = settings.games; const cards = [ { id: 'valorant' as const, name: 'VALORANT', ko: '발로란트', desc: '라운드 · 킬 · 스파이크 이벤트와 대화를 함께 기록', on: g.valorant, st: state.games.valorant }, - { id: 'lol' as const, name: 'League of Legends', ko: '리그 오브 레전드', desc: '킬 · 오브젝트 · 채팅(OCR)과 대화를 함께 기록', on: g.lol, st: state.games.lol }, + { id: 'lol' as const, name: 'League of Legends', ko: '리그 오브 레전드', desc: '킬 · 오브젝트 · 채팅(API)과 대화를 함께 기록', on: g.lol, st: state.games.lol }, ]; return (
    @@ -143,23 +143,14 @@ export function GamesTab() { const { settings, save } = useApp(); const g = settings.games; const users = useLoad(() => gvr.users()); - const region = g.lolOcrRegion; return (
    - save({ games: { lolChatOcr: v } })} /> - -
    - {(['x', 'y', 'w', 'h'] as const).map((k) => ( - - ))} -
    -
    -
    +
    + 롤 채팅은 롤 클라이언트(LCU) API 로 챔피언 선택 · 게임 후 채팅을 받습니다. 게임 중 전체 · 팀 채팅은 롤이 API 로 주지 않아, 게임 로그 파일에 남아 있을 때만 경기 뒤에 붙입니다. 화면 글자 인식(OCR)은 쓰지 않습니다. +
    +
    롤 로그 폴더 (비워 두면 Riot Games 기본 위치에서 찾습니다)
    -
    롤은 채팅 OCR(화면 글자 읽기)도 함께 씁니다. 게임 옵션에서 채팅 타임스탬프를 켜고 '테두리 없음' 창 모드를 쓰면 정확합니다.
    +
    롤 채팅은 롤 클라이언트 API 로 받습니다 (챔피언 선택 · 게임 후 채팅). 화면 글자 인식(OCR)은 쓰지 않습니다.
    ); } diff --git a/app/test/auth.test.ts b/app/test/auth.test.ts index d71a807..6f7e749 100644 --- a/app/test/auth.test.ts +++ b/app/test/auth.test.ts @@ -106,6 +106,20 @@ test('앱 로그인: 등록된 아이디만 열리고, 겜녹이 봇 토큰은 assert.equal(frSt.activeBotToken(), null); await assert.rejects(fr.adminAddUser(STRANGER, 'user'), /최고 관리자만/); await assert.rejects(fr.adminUsers(), /관리자만/); + // 일반 유저도 관리자 아이디는 받는다 (따라갈 사람 목록 정렬). 유저 자신은 관리자가 아니다 + const ids = await fr.adminIds(); + assert.ok(ids.includes(SUPER) && !ids.includes(FRIEND)); + await admin.adminSetRole(FRIEND, 'admin'); + assert.ok((await fr.adminIds()).includes(FRIEND)); + await admin.adminSetRole(FRIEND, 'user'); + // 표시 이름 (실명 숨기기): 최고 관리자만 정하고, 정하면 서버가 저장한 이름 · 로그인 정보가 모두 그 이름이 된다 + await assert.rejects(fr.adminSetDisplayName(FRIEND, '별명'), /최고 관리자만/); + assert.deepEqual((await admin.adminSetDisplayName(FRIEND, '별명')).names, { [FRIEND]: '별명' }); + assert.deepEqual(await fr.displayNames(), { [FRIEND]: '별명' }); + assert.equal((await fr.check()).user?.name, '별명'); + const rows = (await admin.adminUsers()).users; + assert.equal(rows.find((u) => u.id === FRIEND)?.name, '별명'); + assert.deepEqual((await admin.adminSetDisplayName(FRIEND, '')).names, {}); // 다시 켜도 (새 SettingsStore) 로그인 유지 assert.equal((await new AppAuth(s.settingsFor(dir), { version: '1.2.0', openUrl: () => undefined }).check()).status, 'ok'); // 봇 토큰은 이 PC 어디에도 저장되지 않는다 (테스트는 평문 codec 이라 secrets.bin 도 그대로 읽힌다) diff --git a/app/test/bot-gateway.test.ts b/app/test/bot-gateway.test.ts index d187a61..58ddf5f 100644 --- a/app/test/bot-gateway.test.ts +++ b/app/test/bot-gateway.test.ts @@ -179,6 +179,8 @@ test('봇 중계: 로그인 안 한 연결은 막히고, 로그인한 앱은 봇 await a.gw.start(); assert.deepEqual(a.gw.me(), ME); assert.deepEqual(a.gw.guilds().map((g) => g.id), [G, OTHER_G]); + // 지켜보기 전에도 (설정 창이 봇 연결 직후 바로 요청) 가입한 서버 멤버 목록을 받는다 + assert.equal((await a.gw.members(G)).length, 3); const g = await a.gw.watch(G, { commands: true }); assert.equal(g?.name, 'M&L'); await until(() => s.source.commands.includes(G)); diff --git a/app/test/core.test.ts b/app/test/core.test.ts index 601a829..7379c48 100644 --- a/app/test/core.test.ts +++ b/app/test/core.test.ts @@ -132,7 +132,7 @@ test('타임라인 조회: 필터·검색·커서', () => { const dir = tmp(); const store = new Store(path.join(dir, 'db.sqlite')); const tl = new Timeline(store); - store.upsertUser({ id: 'u1', name: '승한', avatar: null }); + store.upsertUser({ id: 'u1', name: '하늘', avatar: null }); store.upsertUser({ id: 'u2', name: '민수', avatar: null }); const t0 = Date.UTC(2026, 9, 15, 12, 0, 0); const texts = ['스모크 깔게 미드로 와', '레이즈 궁 빠졌어', '오퍼 사줘', '배고프다 치킨 먹자', 'B 사이트 로테 하자']; @@ -183,3 +183,28 @@ test('7일 지난 음성만 삭제, 텍스트는 남음', () => { assert.equal(store.getUtterance('old')!.audio_deleted, 1); store.close(); }); + +test('표시 이름: 정한 이름으로 유저 이름 · 지난 범인 분석의 이름을 바꾸고, 새로 들어온 이름에도 쓴다', () => { + const store = new Store(path.join(tmp(), 'db.sqlite')); + store.upsertUser({ id: 'u1', name: '실명이', avatar: null }); + store.upsertUser({ id: 'u2', name: '민수', avatar: null }); + store.db.exec(`CREATE TABLE culprit_analyses (id TEXT PRIMARY KEY, match_id TEXT NOT NULL, created_at INTEGER NOT NULL, created_by TEXT NOT NULL, model TEXT NOT NULL, current INTEGER NOT NULL DEFAULT 1, result TEXT NOT NULL, meta TEXT NOT NULL DEFAULT '{}')`); + store.db + .prepare('INSERT INTO culprit_analyses(id,match_id,created_at,created_by,model,result) VALUES(?,?,?,?,?,?)') + .run('a1', 'm1', 1, JSON.stringify({ id: 'u1', name: '실명이 다른표기' }), 'x', JSON.stringify({ result: { summary: '실명이가 캐리' }, players: [{ name: '실명이' }, { name: '민수' }] })); + store.setDisplayNames({ u1: '별명' }); + assert.equal(store.getUser('u1')?.name, '별명'); + assert.equal(store.getUser('u2')?.name, '민수'); + const r = store.db.prepare('SELECT created_by, result FROM culprit_analyses').get() as any; + assert.equal(JSON.parse(r.created_by).name, '별명'); + assert.ok(!r.result.includes('실명이') && r.result.includes('별명가 캐리'), r.result); + // 디스코드에서 예전 이름이 다시 와도 표시 이름으로 저장, 다시 열어도 유지 + store.upsertUser({ id: 'u1', name: '실명이', avatar: null }); + assert.equal(store.getUser('u1')?.name, '별명'); + const file = store.db.name; + store.close(); + const again = new Store(file); + again.upsertUser({ id: 'u1', name: '실명이', avatar: null }); + assert.equal(again.getUser('u1')?.name, '별명'); + again.close(); +}); diff --git a/app/test/culprit.test.ts b/app/test/culprit.test.ts index d622e01..03e9e7b 100644 --- a/app/test/culprit.test.ts +++ b/app/test/culprit.test.ts @@ -53,9 +53,9 @@ test('범인찾기: 분석 가능 판정과 AI 자료', () => { const input = ctx.culprit.buildInput(m); const lines = input.text.split('\n'); assert.match(lines[0], /^# 경기 발로란트 .* 13:9 \(우리 팀 승리\) · 22라운드/); - // 우리 팀이 P1~P5, 승한은 음성O, 디스코드 계정이 없는 상대는 음성X + // 우리 팀이 P1~P5, 하늘은 음성O, 디스코드 계정이 없는 상대는 음성X const p1 = lines.find((l) => l.startsWith('P1 '))!; - assert.match(p1, /^P1 승한 우리 제트\(타격대\) \d+\/\d+\/\d+ ACS\d+ ADR\d+ KAST\d+% 피해격차[+-]\d+ 첫킬\d+\/첫데스\d+ HS\d+% 설치\d+\/해체\d+ .*음성O$/); + assert.match(p1, /^P1 하늘 우리 제트\(타격대\) \d+\/\d+\/\d+ ACS\d+ ADR\d+ KAST\d+% 피해격차[+-]\d+ 첫킬\d+\/첫데스\d+ HS\d+% 설치\d+\/해체\d+ .*음성O$/); // 기록 점수 (OP.GG OP스코어 계산법): 10명 모두, 이긴 팀 1등 MVP · 진 팀 1등 ACE const head = lines.findIndex((l) => l.startsWith('# 기록 점수 (0~10, OP.GG OP스코어 계산법')); assert.ok(head > 0, '기록 점수 칸'); @@ -176,7 +176,7 @@ test('범인찾기 API: 목록 · 상세 · 내부 전용 경로', async () => { method: 'PUT', url: `/api/culprit/internal/${id}/result`, headers: { 'x-gvr-internal': '1' }, - payload: { result, players: input.players, model: 'claude-opus-5-5', createdBy: { id: 'u1', name: '승한' }, meta: { costUsd: 0.41 } }, + payload: { result, players: input.players, model: 'claude-opus-5-5', createdBy: { id: 'u1', name: '하늘' }, meta: { costUsd: 0.41 } }, }); assert.equal(put.statusCode, 200); const info = (await api.inject({ url: `/api/culprit/matches/${id}` })).json() as CulpritMatchInfo; @@ -194,7 +194,7 @@ test('범인찾기 API: 목록 · 상세 · 내부 전용 경로', async () => { ], ); // 다시 분석하면 이전 결과는 기록으로 남는다 - await api.inject({ method: 'PUT', url: `/api/culprit/internal/${id}/result`, headers: { 'x-gvr-internal': '1' }, payload: { result, players: input.players, model: 'm2', createdBy: { id: 'u1', name: '승한' }, meta: {} } }); + await api.inject({ method: 'PUT', url: `/api/culprit/internal/${id}/result`, headers: { 'x-gvr-internal': '1' }, payload: { result, players: input.players, model: 'm2', createdBy: { id: 'u1', name: '하늘' }, meta: {} } }); const info2 = (await api.inject({ url: `/api/culprit/matches/${id}` })).json() as CulpritMatchInfo; assert.equal(info2.history.length, 2); assert.equal(info2.analysis!.model, 'm2'); diff --git a/app/test/e2e-stt.test.ts b/app/test/e2e-stt.test.ts index e24e01f..503734f 100644 --- a/app/test/e2e-stt.test.ts +++ b/app/test/e2e-stt.test.ts @@ -38,7 +38,7 @@ test('E2E: 발화 → STT 워커 → DB → 실시간 이벤트 → 기록 API', } }; await wait(() => core.stt.status.slots.realtime.state === 'loaded', 60000, 'model load'); - core.store.upsertUser({ id: 'u1', name: '승한', avatar: null }); + core.store.upsertUser({ id: 'u1', name: '하늘', avatar: null }); const fx = path.join(root, 'worker', 'tests', 'fixtures'); const items: [string, string][] = [ ['speech', 'speech_ko.ogg'], diff --git a/app/test/fixtures/culprit-seed.ts b/app/test/fixtures/culprit-seed.ts index 44bdf97..e32b4cd 100644 --- a/app/test/fixtures/culprit-seed.ts +++ b/app/test/fixtures/culprit-seed.ts @@ -46,7 +46,7 @@ export function seedValorant(ctx: ReturnType, opts: { sessionStart const md = makeDemoValorant(VS); const id = 'val-demo'; const users = [ - { id: 'u1', name: '승한', puuid: 'p-sh' }, + { id: 'u1', name: '하늘', puuid: 'p-sh' }, { id: 'u2', name: '민수', puuid: 'p-ms' }, { id: 'u9', name: '도윤', puuid: null }, ]; diff --git a/app/test/fixtures/demo-matches.ts b/app/test/fixtures/demo-matches.ts index 356f492..aef4130 100644 --- a/app/test/fixtures/demo-matches.ts +++ b/app/test/fixtures/demo-matches.ts @@ -37,7 +37,7 @@ function loc() { } export const VAL_PLAYERS = [ - { subject: 'p-sh', gameName: '승한', tagLine: 'KR1', teamId: 'Blue', characterId: AGENT.jett }, + { subject: 'p-sh', gameName: '하늘', tagLine: 'KR1', teamId: 'Blue', characterId: AGENT.jett }, { subject: 'p-ms', gameName: '민수', tagLine: '0707', teamId: 'Blue', characterId: AGENT.sova }, { subject: 'p-jw', gameName: '지우', tagLine: 'KR2', teamId: 'Blue', characterId: AGENT.sage }, { subject: 'p-hw', gameName: '현우', tagLine: 'HW1', teamId: 'Blue', characterId: AGENT.omen }, @@ -132,7 +132,7 @@ export function makeDemoValorant(gameStart: number) { // ------------------------------------------------------------------ 롤 const LOL = [ - { pid: 1, champ: 103, team: 100, puuid: 'l-sh', name: '승한', tag: 'KR1' }, // 아리 미드 + { pid: 1, champ: 103, team: 100, puuid: 'l-sh', name: '하늘', tag: 'KR1' }, // 아리 미드 { pid: 2, champ: 64, team: 100, puuid: 'l-ms', name: '민수', tag: '0707' }, // 리 신 { pid: 3, champ: 86, team: 100, puuid: 'l-hw', name: '현우', tag: 'HW1' }, // 가렌 { pid: 4, champ: 81, team: 100, puuid: 'l-jw', name: '지우', tag: 'KR2' }, // 이즈리얼 diff --git a/app/test/fixtures/make-val-details.ts b/app/test/fixtures/make-val-details.ts index 6ee77f6..d3836cc 100644 --- a/app/test/fixtures/make-val-details.ts +++ b/app/test/fixtures/make-val-details.ts @@ -8,7 +8,7 @@ const VANDAL = '9c82e19d-4575-0200-1a81-3eacf00cf872'; export function makeValDetails(gameStart: number) { const players = [ - { subject: SELF, gameName: '승한', tagLine: 'KR1', teamId: 'Blue', characterId: JETT, competitiveTier: 15, stats: { score: 4200, roundsPlayed: 3, kills: 3, deaths: 1, assists: 1 } }, + { subject: SELF, gameName: '하늘', tagLine: 'KR1', teamId: 'Blue', characterId: JETT, competitiveTier: 15, stats: { score: 4200, roundsPlayed: 3, kills: 3, deaths: 1, assists: 1 } }, { subject: 'ally-2', gameName: '민수', tagLine: 'KR1', teamId: 'Blue', characterId: SAGE, competitiveTier: 14, stats: { score: 1800, roundsPlayed: 3, kills: 1, deaths: 2, assists: 3 } }, { subject: 'enemy-1', gameName: '상대1', tagLine: '0000', teamId: 'Red', characterId: REYNA, competitiveTier: 15, stats: { score: 3000, roundsPlayed: 3, kills: 2, deaths: 3, assists: 0 } }, ]; diff --git a/app/test/games.test.ts b/app/test/games.test.ts index 9c8767c..10e5a2d 100644 --- a/app/test/games.test.ts +++ b/app/test/games.test.ts @@ -50,7 +50,7 @@ test('발로란트·롤 어댑터: 가짜 Riot 서버로 경기 시작→채팅 items: {}, }; const s = defaultSettings(); - store.upsertUser({ id: 'owner', name: '승한', avatar: null }); + store.upsertUser({ id: 'owner', name: '하늘', avatar: null }); const gm = new GameManager(store, assets, worker, stt, tl, bus, () => s, () => 'owner'); gm.start(); try { @@ -87,9 +87,9 @@ test('발로란트·롤 어댑터: 가짜 Riot 서버로 경기 시작→채팅 mock.st.lolPhase = 'InProgress'; mock.st.lolLive = lolLiveData(120, [ { EventID: 0, EventName: 'GameStart', EventTime: 0.05 }, - { EventID: 1, EventName: 'ChampionKill', EventTime: 75.2, KillerName: '승한', VictimName: '적1', Assisters: ['민수'] }, + { EventID: 1, EventName: 'ChampionKill', EventTime: 75.2, KillerName: '하늘', VictimName: '적1', Assisters: ['민수'] }, { EventID: 2, EventName: 'DragonKill', EventTime: 90.0, KillerName: '민수', DragonType: 'Fire', Stolen: 'False' }, - { EventID: 3, EventName: 'TurretKilled', EventTime: 95.0, KillerName: '승한', TurretKilled: 'Turret_T2_R_03_A' }, + { EventID: 3, EventName: 'TurretKilled', EventTime: 95.0, KillerName: '하늘', TurretKilled: 'Turret_T2_R_03_A' }, ]); await until(() => !!store.getMatch('lol-7001'), 5000, 'lol start'); await until(() => store.events('lol-7001').length >= 4, 5000, 'lol events'); diff --git a/app/test/mock/riot.ts b/app/test/mock/riot.ts index 7a28ddc..7732feb 100644 --- a/app/test/mock/riot.ts +++ b/app/test/mock/riot.ts @@ -74,7 +74,7 @@ export async function startMockRiot(dir: string) { // ---- LCU [/^\/lol-gameflow\/v1\/gameflow-phase$/, () => [200, st.lolPhase]], [/^\/lol-gameflow\/v1\/session$/, () => [200, { phase: st.lolPhase, gameData: { gameId: st.lolGameId, queue: { description: '솔로 랭크', id: 420 } } }]], - [/^\/lol-summoner\/v1\/current-summoner$/, () => [200, { puuid: 'lol-self', gameName: '승한', tagLine: 'KR1' }]], + [/^\/lol-summoner\/v1\/current-summoner$/, () => [200, { puuid: 'lol-self', gameName: '하늘', tagLine: 'KR1' }]], [/^\/lol-chat\/v1\/conversations$/, () => [200, st.lolPhase === 'ChampSelect' ? [{ id: 'cs1@champ-select.kr', type: 'championSelect' }] : []]], [/^\/lol-chat\/v1\/conversations\/(.+)\/messages$/, () => [200, [{ id: 'msg1', body: '정글 갱 갈게요', fromSummonerId: 11, timestamp: new Date(Date.now() - 5000).toISOString(), type: 'groupchat' }]]], [/^\/lol-summoner\/v1\/summoners\/(\d+)$/, () => [200, { gameName: '민수' }]], @@ -115,8 +115,8 @@ export function lolLiveData(gameTime: number, events: any[]) { items: [{ itemID: 3031, displayName: '무한의 대검', count: 1 }], }); return { - activePlayer: { riotId: '승한#KR1', summonerName: '승한', currentGold: 500 }, - allPlayers: [player('승한', 'Ahri', '아리', 'ORDER', 3), player('민수', 'LeeSin', '리 신', 'ORDER', 1), player('적1', 'Garen', '가렌', 'CHAOS', 2)], + activePlayer: { riotId: '하늘#KR1', summonerName: '하늘', currentGold: 500 }, + allPlayers: [player('하늘', 'Ahri', '아리', 'ORDER', 3), player('민수', 'LeeSin', '리 신', 'ORDER', 1), player('적1', 'Garen', '가렌', 'CHAOS', 2)], events: { Events: events }, gameData: { gameMode: 'CLASSIC', gameTime, mapName: 'Map11', mapNumber: 11 }, }; @@ -133,7 +133,7 @@ function lolHistory() { { participantId: 6, championId: 86, teamId: 200, stats: { kills: 4, deaths: 6, assists: 2, totalMinionsKilled: 170, neutralMinionsKilled: 0, goldEarned: 8500, win: false } }, ], participantIdentities: [ - { participantId: 1, player: { puuid: 'lol-self', gameName: '승한', tagLine: 'KR1' } }, + { participantId: 1, player: { puuid: 'lol-self', gameName: '하늘', tagLine: 'KR1' } }, { participantId: 2, player: { puuid: 'lol-2', gameName: '민수', tagLine: 'KR1' } }, { participantId: 6, player: { puuid: 'lol-6', gameName: '적1', tagLine: 'KR9' } }, ], diff --git a/docs/culprit-finder-plan.pdf b/docs/culprit-finder-plan.pdf index 1107582..acc6edb 100644 Binary files a/docs/culprit-finder-plan.pdf and b/docs/culprit-finder-plan.pdf differ diff --git a/docs/dev/ARCHITECTURE.md b/docs/dev/ARCHITECTURE.md index b6ac01b..fe7720e 100644 --- a/docs/dev/ARCHITECTURE.md +++ b/docs/dev/ARCHITECTURE.md @@ -10,7 +10,7 @@ app/ 게임 PC 앱 (Electron + Node.js 코어, TypeScript) src/core/ 헤드리스 코어. Electron 없이 `node` 로도 돈다 (리눅스 테스트용) src/main/ Electron 메인 프로세스 (트레이, 창, 마법사, safeStorage) src/renderer/ 설정 창 · 첫 실행 마법사 UI -worker/ Python STT 워커 (faster-whisper, VAD, 음량 정규화, OCR, 모델 관리, 파인튜닝) +worker/ Python STT 워커 (faster-whisper, VAD, 음량 정규화, 롤 로그 채팅, 모델 관리, 파인튜닝) site/server/ 사이트 서버 (Fastify, Discord OAuth2, 기기 중계, 게임 이미지 캐시) site/web/ 사이트 프런트엔드 (React + Vite) packages/shared/ 앱·사이트가 같이 쓰는 TypeScript 타입 (protocol.ts) @@ -71,13 +71,7 @@ tools/ 사전 생성기, 테스트 도구(목 Riot 서버, 음성 // "speech_ratio":0.82, "duration_s":2.4, // "model":"large-v3-turbo", "elapsed_ms":310}} -{"id":"8","op":"ocr_start","window_title":"League of Legends (TM) Client", - "region":{"x":0,"y":0.62,"w":0.32,"h":0.25}, // 창 크기 대비 비율 (채팅 영역) - "fps":3, "lang":"ko"} -// 이벤트: {"event":"ocr_line","ts":1760000000000,"text":"[12:34] [팀] 민수 (아리): 드래곤 가자", -// "parsed":{"game_time":"12:34","channel":"team","sender":"민수","champion":"아리","message":"드래곤 가자"}} -{"id":"9","op":"ocr_stop"} -{"id":"10","op":"ocr_image","path":"..."} // 테스트용: 이미지 한 장 OCR → {"lines":[...]} +// 화면 OCR(ocr_start · ocr_stop · ocr_image)은 v1.3.3 에서 뺐다. 롤 게임 중 채팅은 r3dlog_read (worker/README.md) {"id":"11","op":"train", ...} // 파인튜닝 (worker/gvr_worker/finetune 참고, M8) {"id":"99","op":"shutdown"} @@ -157,7 +151,7 @@ type TimelineItem = ``` `event.data` 예: 킬 `{killer:{puuid,name,agent|champion,team,userId?}, victim:{...}, assists:[...], weapon:{id,name,icon}, headshot?}` · -채팅 `{sender:{name,puuid?,userId?}, channel:'team'|'all'|'party', text, source:'api'|'ocr'|'lcu'}` · +채팅 `{sender:{name,puuid?,userId?}, channel:'team'|'all'|'party', text, source:'api'|'lcu'|'log'|'ocr'(v1.3.2 까지 기록)}` · 오브젝트 `{object:'dragon'|'baron'|'herald'|'grub'|'tower'|'inhibitor', subtype?, team, killer}` · 라운드 종료 `{round, winner:'ally'|'enemy'|teamId, result:'Elimination'|'Bomb detonated'|..., score:{ally,enemy}}` diff --git a/docs/dev/screens/real-dictionary.png b/docs/dev/screens/real-dictionary.png index c2d78bd..5dd99a9 100644 Binary files a/docs/dev/screens/real-dictionary.png and b/docs/dev/screens/real-dictionary.png differ diff --git a/docs/dev/screens/real-locked.png b/docs/dev/screens/real-locked.png index f130177..671f27d 100644 Binary files a/docs/dev/screens/real-locked.png and b/docs/dev/screens/real-locked.png differ diff --git a/docs/dev/screens/real-match-lol.png b/docs/dev/screens/real-match-lol.png index e4e0989..ffbad0c 100644 Binary files a/docs/dev/screens/real-match-lol.png and b/docs/dev/screens/real-match-lol.png differ diff --git a/docs/dev/screens/real-match-valorant.png b/docs/dev/screens/real-match-valorant.png index 8663ac0..b42cb6b 100644 Binary files a/docs/dev/screens/real-match-valorant.png and b/docs/dev/screens/real-match-valorant.png differ diff --git a/docs/dev/screens/real-mobile.png b/docs/dev/screens/real-mobile.png index 537b6c3..2a6eebd 100644 Binary files a/docs/dev/screens/real-mobile.png and b/docs/dev/screens/real-mobile.png differ diff --git a/docs/dev/screens/real-timeline-playing.png b/docs/dev/screens/real-timeline-playing.png index 050a551..2e9f255 100644 Binary files a/docs/dev/screens/real-timeline-playing.png and b/docs/dev/screens/real-timeline-playing.png differ diff --git a/docs/dev/screens/real-timeline.png b/docs/dev/screens/real-timeline.png index 0b7e739..4459e69 100644 Binary files a/docs/dev/screens/real-timeline.png and b/docs/dev/screens/real-timeline.png differ diff --git a/docs/dev/screens/real-user.png b/docs/dev/screens/real-user.png index 4ad9577..94a65e7 100644 Binary files a/docs/dev/screens/real-user.png and b/docs/dev/screens/real-user.png differ diff --git a/docs/gemnoki-final-report.pdf b/docs/gemnoki-final-report.pdf index 845f2fd..5f25b18 100644 Binary files a/docs/gemnoki-final-report.pdf and b/docs/gemnoki-final-report.pdf differ diff --git a/docs/gemnoki-project-plan.pdf b/docs/gemnoki-project-plan.pdf index 98bc359..6be28ca 100644 Binary files a/docs/gemnoki-project-plan.pdf and b/docs/gemnoki-project-plan.pdf differ diff --git a/docs/report/culprit/build.py b/docs/report/culprit/build.py index d561d28..130a1b9 100644 --- a/docs/report/culprit/build.py +++ b/docs/report/culprit/build.py @@ -229,7 +229,7 @@ tr.hl td {{ background:#fff3f4 !important; font-weight:700; }}

    AI에 보내는 자료 모양 (예시)

    # 경기 발로란트 경쟁전 · 어센트 · 13:9 (우리 팀 승리) · 22라운드 · 46분
     # 참가자 (번호 이름 팀 요원(역할) K/D/A ACS 라운드당피해 첫킬/첫데스 헤드샷 설치/해체 스킬사용 음성)
    -P1 승한 우리 제트(타격대) 19/12/7 ACS244 ADR148 첫킬1/첫데스2 HS15% 설치0/해체0 랭크:플래티넘 1 음성O
    +P1 하늘 우리 제트(타격대) 19/12/7 ACS244 ADR148 첫킬1/첫데스2 HS15% 설치0/해체0 랭크:플래티넘 1 음성O
     P5 Duck 우리 킬조이(감시자) 12/15/8 ACS194 ADR92 첫킬2/첫데스2 HS16% 설치0/해체1 랭크:골드 3 음성X
     [e1] R1 0:08 킬 P2 → P6 (클래식)
     [u1] R3 0:05 P1: 현우야 같이 가 기다려 둘 있어
    diff --git a/docs/report/culprit/img/culprit-list.png b/docs/report/culprit/img/culprit-list.png
    index 6433457..27a8ea1 100644
    Binary files a/docs/report/culprit/img/culprit-list.png and b/docs/report/culprit/img/culprit-list.png differ
    diff --git a/docs/report/culprit/img/culprit-mobile-lol.png b/docs/report/culprit/img/culprit-mobile-lol.png
    index ce0dfb9..f6c52e0 100644
    Binary files a/docs/report/culprit/img/culprit-mobile-lol.png and b/docs/report/culprit/img/culprit-mobile-lol.png differ
    diff --git a/docs/report/culprit/img/culprit-result.png b/docs/report/culprit/img/culprit-result.png
    index 5ed3ca8..b52eaa2 100644
    Binary files a/docs/report/culprit/img/culprit-result.png and b/docs/report/culprit/img/culprit-result.png differ
    diff --git a/docs/report/culprit/img/real-list.png b/docs/report/culprit/img/real-list.png
    index bdbf769..80a470d 100644
    Binary files a/docs/report/culprit/img/real-list.png and b/docs/report/culprit/img/real-list.png differ
    diff --git a/docs/report/culprit/img/real-mobile.png b/docs/report/culprit/img/real-mobile.png
    index a1d4626..1c71fb0 100644
    Binary files a/docs/report/culprit/img/real-mobile.png and b/docs/report/culprit/img/real-mobile.png differ
    diff --git a/docs/report/culprit/img/real-result.png b/docs/report/culprit/img/real-result.png
    index d28e714..57cedb1 100644
    Binary files a/docs/report/culprit/img/real-result.png and b/docs/report/culprit/img/real-result.png differ
    diff --git a/docs/report/culprit/img/replay-popup.png b/docs/report/culprit/img/replay-popup.png
    index 4648155..3c016e8 100644
    Binary files a/docs/report/culprit/img/replay-popup.png and b/docs/report/culprit/img/replay-popup.png differ
    diff --git a/docs/report/culprit/img/replay-sync.png b/docs/report/culprit/img/replay-sync.png
    index 481f8ee..b732946 100644
    Binary files a/docs/report/culprit/img/replay-sync.png and b/docs/report/culprit/img/replay-sync.png differ
    diff --git a/docs/report/culprit/mock/culprit-list.html b/docs/report/culprit/mock/culprit-list.html
    index 3b8dfe9..984576a 100644
    --- a/docs/report/culprit/mock/culprit-list.html
    +++ b/docs/report/culprit/mock/culprit-list.html
    @@ -28,7 +28,7 @@ main{flex:1;display:grid;grid-template-columns:520px 1fr;gap:18px;padding:20px 2
       
    겜녹이
    GAME VOICE RECORDER
    타임라인경기유저단어사전🔍 범인찾기 -
    ● 게임 PC 연결됨
    승승한
    +
    ● 게임 PC 연결됨
    하하늘
    @@ -61,7 +61,7 @@ main{flex:1;display:grid;grid-template-columns:520px 1fr;gap:18px;padding:20px 2

    참가자 10명음성 = 대화 기록 있음

    -
    승한 음성우리 팀 · 제트
    +
    하늘 음성우리 팀 · 제트
    민수 음성우리 팀 · 소바
    지우 음성우리 팀 · 세이지
    현우 음성우리 팀 · 오멘
    diff --git a/docs/report/culprit/mock/culprit-mobile-lol.html b/docs/report/culprit/mock/culprit-mobile-lol.html index ca32ec9..4143491 100644 --- a/docs/report/culprit/mock/culprit-mobile-lol.html +++ b/docs/report/culprit/mock/culprit-mobile-lol.html @@ -26,7 +26,7 @@ main{padding:12px;display:flex;flex-direction:column;gap:10px} .p.bad{border-color:#6a2430;background:rgba(255,70,85,.08)} .sn{font-weight:800} -
    겜녹이
    🔍 범인찾기승
    +
    겜녹이
    🔍 범인찾기하
    범인 분석 · LEAGUE OF LEGENDS
    @@ -48,7 +48,7 @@ main{padding:12px;display:flex;flex-direction:column;gap:10px}
    라인전에서 다섯 번 죽어 탑 1차·2차 포탑을 15분 안에 내줬다. 바론 한타에 텔레포트 없이 늦게 합류.
    우리 팀
    -
    승한아리캐리9.0 · 11/2/8
    바론 한타 매혹 세 명. 콜도 정확했다.
    +
    하늘아리캐리9.0 · 11/2/8
    바론 한타 매혹 세 명. 콜도 정확했다.
    지우쓰레쉬숨은 MVP7.5 · 1/5/19
    시야 점수 1위. 용 콜을 가장 먼저 했다.
    현우이즈리얼무난7.0 · 8/4/9
    안정적. 딜량 팀 2위.
    준호다리우스무난6.5 · 8/5/4
    라인전 압승, 한타 진입은 한 박자 빨랐다.
    diff --git a/docs/report/culprit/mock/culprit-result.html b/docs/report/culprit/mock/culprit-result.html index 2cf9dd5..3a3a5fc 100644 --- a/docs/report/culprit/mock/culprit-result.html +++ b/docs/report/culprit/mock/culprit-result.html @@ -41,7 +41,7 @@ main{flex:1;display:flex;flex-direction:column;gap:14px;padding:18px 24px;min-he
    겜녹이
    GAME VOICE RECORDER
    타임라인경기유저단어사전🔍 범인찾기 -
    ● 게임 PC 연결됨
    승승한
    +
    ● 게임 PC 연결됨
    하하늘
    @@ -56,7 +56,7 @@ main{flex:1;display:flex;flex-direction:column;gap:14px;padding:18px 24px;min-he
    우리 팀 범인
    현우오멘 · 14 / 19 / 6 · ACS 171
    평점 3.5 / 10
    범인
    마지막 네 라운드 중 세 번(R21·R23·R24)을 혼자 B 메인으로 먼저 들어가 첫 데스. 팀이 "기다려"라고 두 번 말했는데 그대로 진입했고, 첫 데스 7회로 팀에서 가장 많다. 스모크도 R22 리테이크에서 늦게 깔려 수적 우위를 잃었다.
    -
    R21 0:22대화승한 현우야 같이 가 기다려 둘 있어▶ 듣기
    +
    R21 0:22대화하늘 현우야 같이 가 기다려 둘 있어▶ 듣기
    R21 0:25대화현우 아 그냥 간다 내가 뚫을게▶ 듣기
    R21 0:29킬Nox (사이퍼) ▶ 현우 · 첫 데스, 덫에 걸림타임라인 →
    경기 전체스탯첫 데스 7회 (팀 1위) · 첫 킬 2회스코어보드 →
    @@ -67,14 +67,14 @@ main{flex:1;display:flex;flex-direction:column;gap:14px;padding:18px 24px;min-he
    10명 중 ACS 가장 낮고, 상대가 이긴 13라운드 중 Kiwi 가 기여(킬·어시스트·생존)한 라운드는 5번뿐. R15 에 혼자 장비를 안 사서 4:5 로 싸웠고, 같은 라운드에 전체 채팅으로 "ff" 를 쳤다. 팀이 이긴 건 Lumi 와 Haru 덕분.
    R15 0:00경제Kiwi 혼자 900 크레딧 사용 (팀 평균 4,200)라운드 →
    R15 1:12채팅전체 Kiwi ff 그냥타임라인 →
    -
    R17 0:41킬승한 (제트) ▶ Kiwi · 혼자 A 메인 정찰하다 잡힘타임라인 →
    +
    R17 0:41킬하늘 (제트) ▶ Kiwi · 혼자 A 메인 정찰하다 잡힘타임라인 →
    경기 전체스탯ACS 132 (10명 중 10위) · 피해량 라운드당 88스코어보드 →

    우리 팀 5명 평가평점 · 한 줄 평

    -
    승한제트 · 음성 O
    24/15/5
    ACS 272
    8.5캐리
    오퍼레이터 첫 킬 8회. 콜도 가장 많고 정확했다. 후반에 혼자 남아도 끝까지 침착.
    +
    하늘제트 · 음성 O
    24/15/5
    ACS 272
    8.5캐리
    오퍼레이터 첫 킬 8회. 콜도 가장 많고 정확했다. 후반에 혼자 남아도 끝까지 침착.
    지우세이지 · 음성 O
    12/16/13
    ACS 168
    7.5숨은 MVP
    부활 5번 중 3번이 라운드 승리로 이어짐. 킬은 적어도 벽 타이밍이 좋았다.
    민수소바 · 음성 O
    16/17/9
    ACS 204
    7.0무난
    정찰 화살 정보 콜이 꾸준했다. R14 리테이크는 민수 드론 정보로 이김.
    Duck#KR3피닉스 · 음성 X
    15/17/4
    ACS 196
    5.5무난
    음성채널에 없어 기록으로만 봄. 스탯은 평균, 세이브 라운드에 무기를 사서 경제가 두 번 꼬임.
    diff --git a/docs/report/culprit/mock/header.inc b/docs/report/culprit/mock/header.inc index 56a6bf4..28c3d79 100644 --- a/docs/report/culprit/mock/header.inc +++ b/docs/report/culprit/mock/header.inc @@ -2,5 +2,5 @@
    겜녹이
    GAME VOICE RECORDER
    타임라인경기유저단어사전🔍 범인찾기 -
    ● 게임 PC 연결됨
    승승한
    +
    ● 게임 PC 연결됨
    하하늘
    diff --git a/docs/report/culprit/mock/replay-popup.html b/docs/report/culprit/mock/replay-popup.html index 9d07b06..223189e 100644 --- a/docs/report/culprit/mock/replay-popup.html +++ b/docs/report/culprit/mock/replay-popup.html @@ -35,7 +35,7 @@ body{width:1440px;height:810px;overflow:hidden;position:relative;background:#050

    이 리플레이의 녹음 기록이 있어요

    리플레이와 동기화하시겠습니까? 리플레이 시간에 맞춰 그때 한 말과 이벤트를 보여 주고 음성을 들려 줍니다.
    -
    소환사의 협곡 · 내전 승리
    10월 15일 21:55 · 38분 · 승한(아리) 외 4명 녹음
    +
    소환사의 협곡 · 내전 승리
    10월 15일 21:55 · 38분 · 하늘(아리) 외 4명 녹음
    ✓음성 대화 텍스트655문장
    ✓음성 파일남아 있음 · 10월 22일 삭제 예정
    ✓킬 · 오브젝트 · 채팅112개
    diff --git a/docs/report/culprit/mock/replay-sync.html b/docs/report/culprit/mock/replay-sync.html index 270354f..fd4094c 100644 --- a/docs/report/culprit/mock/replay-sync.html +++ b/docs/report/culprit/mock/replay-sync.html @@ -49,19 +49,19 @@ main{flex:1;display:grid;grid-template-columns:1fr 300px;min-height:0}
    7:55
    지우 쓰레쉬
    용 쪽 시야 없어 와드 하나 박을게
    -
    8:05
    승한 아리
    미드 밀고 갈게 민수야 용 앞으로 와
    +
    8:05
    하늘 아리
    미드 밀고 갈게 민수야 용 앞으로 와
    8:12
    지우 쓰레쉬 🔍 범인 근거
    민수야 용 같이 하자 바텀 밀었어
    지금 8:21
    8:20
    민수 리 신 🔍 범인 근거
    아니 탑 갱 각이야 잠깐만
    🔊 재생 중
    8:41
    지우 쓰레쉬
    아 용 지금 하는데 상대 정글 보여
    8:55
    Kiwi ▶ 지우· 어시 Lumi
    9:02
    상대 팀 바다 드래곤 처치 · Kiwi
    -
    9:06
    승한 아리
    괜찮아 다음 용 준비하자
    +
    9:06
    하늘 아리
    괜찮아 다음 용 준비하자

    지금 말하는 사람

    민수
    -
    승한
    +
    하늘
    지우
    현우
    준호
    diff --git a/docs/report/culprit/plan.html b/docs/report/culprit/plan.html index 252e71f..c167321 100644 --- a/docs/report/culprit/plan.html +++ b/docs/report/culprit/plan.html @@ -298,7 +298,7 @@ tr.hl td { background:#fff3f4 !important; font-weight:700; }

    AI에 보내는 자료 모양 (예시)

    # 경기 발로란트 경쟁전 · 어센트 · 13:9 (우리 팀 승리) · 22라운드 · 46분
     # 참가자 (번호 이름 팀 요원(역할) K/D/A ACS 라운드당피해 첫킬/첫데스 헤드샷 설치/해체 스킬사용 음성)
    -P1 승한 우리 제트(타격대) 19/12/7 ACS244 ADR148 첫킬1/첫데스2 HS15% 설치0/해체0 랭크:플래티넘 1 음성O
    +P1 하늘 우리 제트(타격대) 19/12/7 ACS244 ADR148 첫킬1/첫데스2 HS15% 설치0/해체0 랭크:플래티넘 1 음성O
     P5 Duck 우리 킬조이(감시자) 12/15/8 ACS194 ADR92 첫킬2/첫데스2 HS16% 설치0/해체1 랭크:골드 3 음성X
     [e1] R1 0:08 킬 P2 → P6 (클래식)
     [u1] R3 0:05 P1: 현우야 같이 가 기다려 둘 있어
    diff --git a/docs/report/img/discord-notice.png b/docs/report/img/discord-notice.png
    index 9bedb4c..a17263e 100644
    Binary files a/docs/report/img/discord-notice.png and b/docs/report/img/discord-notice.png differ
    diff --git a/docs/report/img/site-locked.png b/docs/report/img/site-locked.png
    index f0e9df9..876e285 100644
    Binary files a/docs/report/img/site-locked.png and b/docs/report/img/site-locked.png differ
    diff --git a/docs/report/img/site-match-lol.png b/docs/report/img/site-match-lol.png
    index 38cdba1..bd6550a 100644
    Binary files a/docs/report/img/site-match-lol.png and b/docs/report/img/site-match-lol.png differ
    diff --git a/docs/report/img/site-match.png b/docs/report/img/site-match.png
    index 92d4350..d2f6bc9 100644
    Binary files a/docs/report/img/site-match.png and b/docs/report/img/site-match.png differ
    diff --git a/docs/report/img/site-mobile.png b/docs/report/img/site-mobile.png
    index 7456423..ebf1f07 100644
    Binary files a/docs/report/img/site-mobile.png and b/docs/report/img/site-mobile.png differ
    diff --git a/docs/report/img/site-timeline.png b/docs/report/img/site-timeline.png
    index e7f749c..56e40eb 100644
    Binary files a/docs/report/img/site-timeline.png and b/docs/report/img/site-timeline.png differ
    diff --git a/docs/report/mock/discord-notice.html b/docs/report/mock/discord-notice.html
    index a4dcda7..fa8d482 100644
    --- a/docs/report/mock/discord-notice.html
    +++ b/docs/report/mock/discord-notice.html
    @@ -40,7 +40,7 @@ body{width:1040px;height:600px;overflow:hidden;background:#313338;color:#dbdee1;
       
    # 일반
    # 전적-공유
    음성 채널
    🔊 발로 음성방
    -
    승승한
    +
    하하늘
    민민수
    지지우
    현현우 🚫녹음 제외
    @@ -55,7 +55,7 @@ body{width:1040px;height:600px;overflow:hidden;background:#313338;color:#dbdee1;
    # 일반
    -
    승
    승한오늘 오후 9:07
    다들 들어와 랭겜 ㄱㄱ
    +
    하
    하늘오늘 오후 9:07
    다들 들어와 랭겜 ㄱㄱ
    현우 님이 /녹음제외 사용
    겜녹이 앱오늘 오후 9:09 diff --git a/docs/report/mock/site-locked.html b/docs/report/mock/site-locked.html index ae6f2f9..47b3a3e 100644 --- a/docs/report/mock/site-locked.html +++ b/docs/report/mock/site-locked.html @@ -27,7 +27,7 @@ body{width:1440px;height:820px;overflow:hidden;position:relative}
    기록은 게임 PC에만 저장되어 있어서, 프로그램이 켜져 있을 때만 볼 수 있어요.
    프로그램이 다시 연결되면 이 화면은 자동으로 사라집니다.
    사이트 서버● 정상
    -
    등록된 게임 PC승한의 게임 PC (RTX 5070 Ti)
    +
    등록된 게임 PC하늘의 게임 PC (RTX 5070 Ti)
    프로그램 상태● 연결 해제됨 · 마지막 응답 오늘 23:41 (12분 전)
    다시 확인5초마다 자동 확인 중
    diff --git a/docs/report/mock/site-match-lol.html b/docs/report/mock/site-match-lol.html index 569a440..a30e6e1 100644 --- a/docs/report/mock/site-match-lol.html +++ b/docs/report/mock/site-match-lol.html @@ -66,8 +66,8 @@ td{text-align:right;padding:8px 4px;border-bottom:1px solid #18283a}

    대화 · 킬 · 오브젝트 (게임 시간)현실 시간은 마우스를 올리면 표시

    20:41
    민수 · 리 신
    드래곤 30초 남았어 바텀 웨이브 밀고 와
    21:02
    지우 드래곤 앞 제어 와드 설치
    -
    21:14
    승한 · 아리 ▶ 재생 중
    지금 이니시 걸어 내가 매혹 맞췄어
    -
    21:16
    승한 ▶ 르블랑 · 어시 민수, 지우
    +
    21:14
    하늘 · 아리 ▶ 재생 중
    지금 이니시 걸어 내가 매혹 맞췄어
    +
    21:16
    하늘 ▶ 르블랑 · 어시 민수, 지우
    21:19
    민수 ▶ 세주아니 더블 킬
    21:24
    지우 · 쓰레쉬
    한타 이겼다 용 먹자 용
    21:31
    💬 팀 민수 (리 신) 용 치자 바론 말고 OCR
    @@ -79,7 +79,7 @@ td{text-align:right;padding:8px 4px;border-bottom:1px solid #18283a}

    스코어보드 · 우리 팀21:14 기준

    - + @@ -87,7 +87,7 @@ td{text-align:right;padding:8px 4px;border-bottom:1px solid #18283a}
    소환사K/D/ACS골드
    승한6/1/41889.4k
    하늘6/1/41889.4k
    민수4/2/71328.1k
    현우2/3/31707.6k
    Ezreal#KR75/2/52019.0k
    이 경기 발화량
    -
    승한7분 02초
    +
    하늘7분 02초
    민수5분 48초
    지우4분 11초
    diff --git a/docs/report/mock/site-match.html b/docs/report/mock/site-match.html index 9c347d9..12cd6bb 100644 --- a/docs/report/mock/site-match.html +++ b/docs/report/mock/site-match.html @@ -54,16 +54,16 @@ td{text-align:right;padding:7px 4px;border-bottom:1px solid #1c2b39}

    ROUND 7 · 대화 + 킬피드🔁 라운드 전체 이어듣기

    -
    0:40승승한▶Lumi#KR1헤드샷
    +
    0:40하하늘▶Lumi#KR1헤드샷
    0:47지지우▶Nox#0420
    1:08Haru#KR2▶민민수· 데스
    -
    0:31승한 A 메인 둘 봤어 하나 체력 낮아
    +
    0:31하늘 A 메인 둘 봤어 하나 체력 낮아
    0:38지우 내가 스모크 깔게 들어가 들어가
    0:41민수 나이스 원탭!
    0:51💬 팀 민수 스파이크 설치함 B로 돌지마
    -
    1:02승한 레이즈 하나 남았어 메인 쪽에서 와 시간 끌어
    +
    1:02하늘 레이즈 하나 남았어 메인 쪽에서 와 시간 끌어
    1:09민수 아 미안 셰리프 맞았다
    @@ -71,7 +71,7 @@ td{text-align:right;padding:7px 4px;border-bottom:1px solid #1c2b39}

    우리 팀 스코어보드

    - + diff --git a/docs/report/mock/site-mobile.html b/docs/report/mock/site-mobile.html index e653de6..41af501 100644 --- a/docs/report/mock/site-mobile.html +++ b/docs/report/mock/site-mobile.html @@ -27,12 +27,12 @@ header{padding:6px 16px 10px;display:flex;align-items:center;gap:10px}
    어센트 13:9👥 전체 유저💬 채팅⚔ 킬
    R7공격 · 4 : 2
    -
    승
    R7 · 0:31 승한
    A 메인 둘 봤어 하나 체력 낮아
    +
    하
    R7 · 0:31 하늘
    A 메인 둘 봤어 하나 체력 낮아
    지
    R7 · 0:38 지우
    내가 스모크 깔게 들어가 들어가
    -
    승한 ▶ Lumi#KR1 · 헤드샷
    +
    하늘 ▶ Lumi#KR1 · 헤드샷
    민
    R7 · 0:44 민수
    [잡음]
    💬 [팀] 민수: 스파이크 설치함
    -
    승
    R7 · 1:02 승한
    레이즈 하나 남았어 메인 쪽에서 와 시간 끌어
    +
    하
    R7 · 1:02 하늘
    레이즈 하나 남았어 메인 쪽에서 와 시간 끌어
    🏆 라운드 승리 · 5 : 2
    R8공격 · 5 : 2
    민
    R8 · 구매 민수
    나 오퍼 사줄 사람
    diff --git a/docs/report/mock/site-timeline.html b/docs/report/mock/site-timeline.html index 42cffea..b52640f 100644 --- a/docs/report/mock/site-timeline.html +++ b/docs/report/mock/site-timeline.html @@ -64,13 +64,13 @@ footer{height:96px;border-top:1px solid var(--line);background:#0f1b26;display:f
    겜녹이
    GAME VOICE RECORDER
    타임라인경기유저단어사전 -
    녹음 중 · #발로 음성방 · 4명
    ● 게임 PC 연결됨
    승승한
    +
    녹음 중 · #발로 음성방 · 4명
    ● 게임 PC 연결됨
    하하늘
    플레이어KDAACS
    승한 제트21145268
    하늘 제트21145268
    민수 소바15169201
    지우 세이지111512164
    현우 오멘16137222