8 Commits

Author SHA1 Message Date
EJClaw
59cfe1c377 3D 리플레이 1인칭 시야: 세로 70° 고정 대신 게임처럼 가로 103° (16:9 게임 화면을 창에 꽉 차게 잘라 보여 줌 — 가로로 긴 창에서 약 120° 까지 넓어지던 것) · 줌은 tan 배율
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:30:57 +09:00
EJClaw
c4f576941c v1.12.1 릴리스 기록 · README 링크
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:23:49 +09:00
EJClaw
f4faf49be2 리플레이 변환기 13.10 지원: ValorantReplayParser 28e24af → fbf24b6 (13.09 · 13.10 페이로드 변환, 13.10 전투 기록 배치) · 밴딧은 파서 새 이름 "Bandit" 대신 예전 이름 "Compact Pistol" 로 내보냄 (사이트 · 뽑아 둔 총 모델 이름) · v1.12.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:08:42 +09:00
EJClaw
5cf8f0f76a v1.12.0 릴리스 기록 · README 링크
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 12:03:52 +09:00
EJClaw
e8a1c4d5b3 경기 탭 리플레이 필터: 리플레이 있는 경기 / 없는 경기 (게임 PC 에 발로란트 .vrf 가 있는지, GET /api/matches?replay=yes|no · 롤 제외 · 요약에 replay) · 예전 앱이면 업데이트 안내 · 롤을 고르면 숨김 · '필터 초기화' · 목 서버 · 시험 · v1.12.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 11:49:18 +09:00
EJClaw
1e892d1523 경기 탭: 더 보기 요청 중 새로고침 · 필터 변경하면 늦게 온 더 보기 응답은 버림 (moreGen 세대)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 09:40:45 +09:00
EJClaw
83cc9d1596 경기 탭 새로고침 버튼 (지금 필터로 첫 쪽부터 다시 받음 · 받는 동안 '불러오는 중…' 으로 잠금, useLoad loading)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 09:37:54 +09:00
EJClaw
ba45aa8792 v1.11.2 릴리스 기록 · README 링크
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 08:08:31 +09:00
16 changed files with 162 additions and 27 deletions

View File

@@ -8,7 +8,7 @@
- 설계·계획: [`docs/gemnoki-project-plan.pdf`](docs/gemnoki-project-plan.pdf), 개발 구조·인터페이스: [`docs/dev/ARCHITECTURE.md`](docs/dev/ARCHITECTURE.md) - 설계·계획: [`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/`) - 범인찾기 · 리플레이 동기화 계획서 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) - **제작 완료 보고서 (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.11.1](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.11.1) (`GameVoiceRecorder-1.11.1-win-x64.zip` 권장, 단일 파일 `GameVoiceRecorder-1.11.1-portable.exe`) · 바뀐 점 보고서 [`docs/gemnoki-v1.3.7-report.pdf`](docs/gemnoki-v1.3.7-report.pdf) · 처음 버전 [v1.0.0](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.0.0) - Windows 실행 파일: Gitea 릴리스 [v1.12.1](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.12.1) (`GameVoiceRecorder-1.12.1-win-x64.zip` 권장, 단일 파일 `GameVoiceRecorder-1.12.1-portable.exe`) · 바뀐 점 보고서 [`docs/gemnoki-v1.3.7-report.pdf`](docs/gemnoki-v1.3.7-report.pdf) · 처음 버전 [v1.0.0](https://git.tkrmagid.kr/tkrmagid/game_voice_recorder/releases/tag/v1.0.0)
## 로그인 · 관리자 (v1.2.0~) ## 로그인 · 관리자 (v1.2.0~)

4
app/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "gvr-app", "name": "gvr-app",
"version": "1.11.2", "version": "1.12.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "gvr-app", "name": "gvr-app",
"version": "1.11.2", "version": "1.12.1",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@discordjs/voice": "^0.19.2", "@discordjs/voice": "^0.19.2",

View File

@@ -1,7 +1,7 @@
{ {
"name": "gvr-app", "name": "gvr-app",
"productName": "겜녹이", "productName": "겜녹이",
"version": "1.11.2", "version": "1.12.1",
"description": "겜녹이 (Game Voice Recorder) - 게임 연동 디스코드 음성 기록", "description": "겜녹이 (Game Voice Recorder) - 게임 연동 디스코드 음성 기록",
"private": true, "private": true,
"main": "dist/main.cjs", "main": "dist/main.cjs",

View File

@@ -318,9 +318,16 @@ export async function buildApi(d: ApiDeps): Promise<FastifyInstance> {
app.get<{ Querystring: Record<string, string> }>('/api/matches', async (req) => { app.get<{ Querystring: Record<string, string> }>('/api/matches', async (req) => {
const q = req.query; const q = req.query;
// 리플레이 필터 (v1.12.0): yes = 이 PC 에 리플레이 파일(.vrf)이 있는 발로란트 경기, no = 없는 발로란트 경기
const replay = q.replay === 'yes' || q.replay === 'no' ? q.replay : undefined;
if (replay && q.game && q.game !== 'valorant') return [];
const replayIds = d.replays ? d.replays.list().map((r) => `val-${r.matchId}`) : [];
const hasReplay = new Set(replayIds);
return store return store
.listMatches({ .listMatches({
game: q.game || undefined, game: replay ? 'valorant' : q.game || undefined,
ids: replay === 'yes' ? replayIds : undefined,
skipIds: replay === 'no' ? replayIds : undefined,
before: q.before ? Number(q.before) : undefined, before: q.before ? Number(q.before) : undefined,
after: q.after ? Number(q.after) : undefined, after: q.after ? Number(q.after) : undefined,
limit: q.limit ? Math.min(Number(q.limit), 200) : 50, limit: q.limit ? Math.min(Number(q.limit), 200) : 50,
@@ -330,7 +337,11 @@ export async function buildApi(d: ApiDeps): Promise<FastifyInstance> {
onlyModes: q.mode ? d.games.modeKeys((name) => name === q.mode) : undefined, onlyModes: q.mode ? d.games.modeKeys((name) => name === q.mode) : undefined,
skipModes: d.games.modeKeys((name) => name === HIDDEN_MODE), skipModes: d.games.modeKeys((name) => name === HIDDEN_MODE),
}) })
.map((m) => d.games.summary(m)); .map((m) => {
const s = d.games.summary(m);
if (d.replays && m.game === 'valorant') s.replay = hasReplay.has(m.id);
return s;
});
}); });
// 모드 필터 목록 (v1.11.0): 모드 이름별 경기 수 // 모드 필터 목록 (v1.11.0): 모드 이름별 경기 수
app.get<{ Querystring: Record<string, string> }>('/api/matches/modes', async (req) => d.games.modeList(req.query.game || undefined)); app.get<{ Querystring: Record<string, string> }>('/api/matches/modes', async (req) => d.games.modeList(req.query.game || undefined));

View File

@@ -447,6 +447,8 @@ export class Store {
after?: number; after?: number;
limit?: number; limit?: number;
ids?: string[]; ids?: string[];
/** 이 경기들은 빼고 (리플레이 없는 경기 필터, v1.12.0) */
skipIds?: string[];
has?: 'timeline' | 'voice'; has?: 'timeline' | 'voice';
onlyModes?: ModeKey[]; onlyModes?: ModeKey[];
skipModes?: ModeKey[]; skipModes?: ModeKey[];
@@ -482,6 +484,10 @@ export class Store {
where.push(`id IN (${opts.ids.map(() => '?').join(',')})`); where.push(`id IN (${opts.ids.map(() => '?').join(',')})`);
args.push(...opts.ids); args.push(...opts.ids);
} }
if (opts.skipIds?.length) {
where.push(`id NOT IN (${opts.skipIds.map(() => '?').join(',')})`);
args.push(...opts.skipIds);
}
return this.db return this.db
.prepare(`SELECT * FROM matches ${where.length ? 'WHERE ' + where.join(' AND ') : ''} ORDER BY started_at DESC LIMIT ?`) .prepare(`SELECT * FROM matches ${where.length ? 'WHERE ' + where.join(' AND ') : ''} ORDER BY started_at DESC LIMIT ?`)
.all(...args, opts.limit ?? 50) as MatchRow[]; .all(...args, opts.limit ?? 50) as MatchRow[];

View File

@@ -182,3 +182,31 @@ test('실제 변환기 (tools/replay-extract 리눅스 빌드 + 13.08 리플레
assert.equal(j.players.length, 10); assert.equal(j.players.length, 10);
assert.ok(j.kills.length > 100); assert.ok(j.kills.length > 100);
}); });
test('경기 목록 리플레이 필터: yes = 리플레이 파일이 있는 발로란트 경기, no = 없는 발로란트 경기 (롤 제외) · 요약에 replay', async () => {
const s = setup();
const app = await buildApi({
store: s.store,
timeline: new Timeline(s.store),
games: { modeKeys: () => [], summary: (m: any) => ({ id: m.id, game: m.game }) } as any,
dict: {} as any,
culprit: {} as any,
bus: new Bus(),
settings: () => ({}) as any,
trainingDir: () => path.join(s.dir, 'training'),
overviewExtra: () => ({ guild: null, recording: {} as any }),
version: 'test',
replays: s.replays,
});
const get = async (qs: string) => (await app.inject({ url: `/api/matches${qs}` })).json() as { id: string; replay?: boolean }[];
// 리플레이를 하나도 안 받았으면 yes 는 빈 목록, no 는 발로란트 경기 전부
assert.deepEqual(await get('?replay=yes'), []);
assert.deepEqual((await get('?replay=no')).map((m) => m.id), [`val-${ID}`, `val-${ID2}`]);
fs.writeFileSync(path.join(s.demos, `${ID}.vrf`), 'vrf');
(s.replays as any).scanCache = null; // 10초 목록 캐시 무시
const all = await get('');
assert.deepEqual(Object.fromEntries(all.map((m) => [m.id, m.replay])), { [`val-${ID}`]: true, [`val-${ID2}`]: false, 'lol-KR_1': undefined });
assert.deepEqual((await get('?replay=yes')).map((m) => m.id), [`val-${ID}`]);
assert.deepEqual((await get('?replay=no')).map((m) => m.id), [`val-${ID2}`]);
assert.deepEqual(await get('?replay=no&game=lol'), []);
});

View File

@@ -287,6 +287,22 @@ VOICE E2E PASS
- 화면: 목 서버 + 헤드리스 크롬(playwright-core)으로 내 정보(이름 저장 · 머리글 반영 · 색 · 녹음 제외 · 되돌리기) · 관리 페이지(새 버전 링크 · 이름 바꾸기 · 앱 유저 등록) · 모바일 390px 확인, 콘솔 오류 0 - 화면: 목 서버 + 헤드리스 크롬(playwright-core)으로 내 정보(이름 저장 · 머리글 반영 · 색 · 녹음 제외 · 되돌리기) · 관리 페이지(새 버전 링크 · 이름 바꾸기 · 앱 유저 등록) · 모바일 390px 확인, 콘솔 오류 0
- 배포: 사이트 서버 다시 배포 (`/site/admin/overview` · `/site/profile/name` 로그인 없이 401, 컨테이너에서 Gitea 최신 릴리스 조회 확인), Windows CI (b9431c1, full) 8개 모두 PASS · 앱 버전 1.6.0 → Gitea 릴리스 v1.6.0 (v1.5.0 · v1.4.3 에 새 버전 안내) - 배포: 사이트 서버 다시 배포 (`/site/admin/overview` · `/site/profile/name` 로그인 없이 401, 컨테이너에서 Gitea 최신 릴리스 조회 확인), Windows CI (b9431c1, full) 8개 모두 PASS · 앱 버전 1.6.0 → Gitea 릴리스 v1.6.0 (v1.5.0 · v1.4.3 에 새 버전 안내)
## v1.12.1 — 리플레이 변환기 13.10 지원 (2026-11-21)
- 증상: 13.10 경기 3D 리플레이 변환 실패 `InvalidReplayInfoException: Unsupported VALORANT replay version: no payload transform is registered for replay branch '++Ares-Core+release-13.10'`. 원인: 고정한 파서 28e24af(10-16)에는 13.08 변환만 있음 (13.09 · 13.10 은 그 뒤 upstream main 에 추가).
- 변환기 (f4faf49): `fetch-parser.sh` PARSER_COMMIT 28e24af → fbf24b6 (upstream main, 13.09 · 13.10 페이로드 변환 · 13.10 전투 기록 배치). 파서가 밴딧을 "Bandit" 으로 부르게 되어 변환기가 예전 이름 "Compact Pistol" 로 내보냄 (사이트 이름 표 · 뽑아 둔 1/3인칭 총 모델 키). 파서 테스트 Replay.Encoding 1566 · Replay.Valorant 1493 모두 PASS, `--self-test` PASS. 13.08 어비스 vrf 변환 전후 비교: states 외 모든 항목 동일 (states 16,974 → 17,024, BoostIdleState 등 대기 상태 50개가 더 잡힘).
- 배포: Windows CI (f4faf49, full) 8개 모두 PASS (parser @ fbf24b6, 13.08 실제 변환, 앱 smoke 버전 1.12.1) · Gitea 릴리스 v1.12.1 (portable.exe 206,739,296 B · win-x64.zip 302,978,445 B, 올린 파일 sha256 일치) (v1.12.0 ~ v1.8.0 에 새 버전 안내). 13.10 실제 vrf 로는 확인하지 못함 (사용자 파일 53MB 가 Discord 첨부 한도 초과).
## v1.12.0 — 경기 탭 리플레이 필터 (2026-11-21)
- 앱 · 사이트 (e8a1c4d): `GET /api/matches?replay=yes|no` — 게임 PC 에 리플레이 파일(.vrf)이 있는/없는 발로란트 경기만 (`Replays.list()` 경기 ID → `listMatches` `ids` · `skipIds`, 롤 제외), 경기 요약에 `replay`. 사이트 경기 탭에 리플레이 칸 (롤을 고르면 숨김, `replay` 를 모르는 예전 앱이면 업데이트 안내), '필터 초기화'. 앱 테스트 88개 PASS (리플레이 필터 시험 추가) · 타입 검사(앱 · 웹) · 웹 빌드 통과. 목 서버 + 헤드리스 크롬: 리플레이 있는 경기 1개(데모), 없는 경기 50 → 더 보기 62 (모두 발로란트 · 리플레이 없음), 롤 고르면 칸 사라지고 필터 풀림, 예전 앱 흉내(replay 없음)면 안내 문구
- 배포: 사이트 서버 다시 배포 (사이트 스크립트 = 빌드 index-B-NXd0zY.js) · Windows CI (e8a1c4d, full) 8개 모두 PASS (앱 smoke 버전 1.12.0) · Gitea 릴리스 v1.12.0 (portable.exe 206,702,580 B · win-x64.zip 302,938,557 B, 올린 파일 sha256 일치) (v1.11.2 ~ v1.8.0 에 새 버전 안내)
## v1.11.2 — Riot ID 칸 고치기 취소 뒤 새 이름 반영 (2026-11-21)
- 앱 (d237228): `RiotRow` 동기화 효과 의존성 `[server, dirty]` — 고치는 중에 이름이 바뀌면 미뤘다가, 입력을 되돌려 고치기를 그만두면 새 이름으로. 렌더러 목 + 헤드리스 크롬: 탭을 연 채 `민준#KR1` → `민준바꿈#KR9`, 현우 칸을 고치는 중 `HW#7777` → `HW새이름#8888` 로 바뀌어도 입력 유지 → 입력을 `HW#7777` 로 되돌리니 `HW새이름#8888` · `✓ 1개`. 앱 테스트 87개 PASS · 타입 검사(앱 · 렌더러) 통과
- 배포: Windows CI (d237228, full) 8개 모두 PASS (앱 smoke 버전 1.11.2) · Gitea 릴리스 v1.11.2 (portable.exe 206,693,515 B · win-x64.zip 302,941,251 B, 올린 파일 sha256 일치) (v1.11.1 ~ v1.8.0 에 새 버전 안내)
## v1.11.1 — 앱 게임 연동 탭 Riot ID 표 실시간 갱신 (2026-11-21) ## v1.11.1 — 앱 게임 연동 탭 Riot ID 표 실시간 갱신 (2026-11-21)
- 앱 (673f242): `Bus.usersRev`(users.updated 횟수) → `AppState.usersRev` → 게임 연동 탭이 유저 목록을 다시 받고, 고치는 중이 아닌 Riot ID 입력칸을 새 값으로. 앱 테스트 87개 PASS · 타입 검사(앱 · 렌더러) 통과. 렌더러 목(`__gvrMockRename`) + 헤드리스 크롬: 탭을 연 채 `민준#KR1` → `민준바꿈#KR9` 로 바뀜, 입력 중인 칸(서연)은 그대로 - 앱 (673f242): `Bus.usersRev`(users.updated 횟수) → `AppState.usersRev` → 게임 연동 탭이 유저 목록을 다시 받고, 고치는 중이 아닌 Riot ID 입력칸을 새 값으로. 앱 테스트 87개 PASS · 타입 검사(앱 · 렌더러) 통과. 렌더러 목(`__gvrMockRename`) + 헤드리스 크롬: 탭을 연 채 `민준#KR1` → `민준바꿈#KR9` 로 바뀜, 입력 중인 칸(서연)은 그대로

View File

@@ -169,6 +169,8 @@ export interface MatchSummary {
source?: 'live' | 'history'; source?: 'live' | 'history';
/** 목소리가 녹음된 경기 (잡음 제외, v1.9.0 앱부터) */ /** 목소리가 녹음된 경기 (잡음 제외, v1.9.0 앱부터) */
voice?: boolean; voice?: boolean;
/** 발로란트: 이 PC 에 리플레이 파일(.vrf)이 있는 경기 (경기 목록, v1.12.0 앱부터) */
replay?: boolean;
} }
export interface MatchPlayer { export interface MatchPlayer {

View File

@@ -4,7 +4,7 @@ import assert from 'node:assert/strict';
import type { ReplayFile } from '../../web/src/lib/replay.ts'; import type { ReplayFile } from '../../web/src/lib/replay.ts';
import { buildDirector, shotIndexAt, FIGHT_LEAD, type Shot } from '../../web/src/lib/director.ts'; import { buildDirector, shotIndexAt, FIGHT_LEAD, type Shot } from '../../web/src/lib/director.ts';
import { boardAt, boardIndex, loadoutAt, sideSwaps, teamScoreAt } from '../../web/src/lib/scoreboard.ts'; import { boardAt, boardIndex, loadoutAt, sideSwaps, teamScoreAt } from '../../web/src/lib/scoreboard.ts';
import { fitDistance } from '../../web/src/lib/director.ts'; import { fitDistance, gameFov } from '../../web/src/lib/director.ts';
import * as THREE from '../../web/node_modules/three/build/three.module.js'; import * as THREE from '../../web/node_modules/three/build/three.module.js';
// 선수 0·1·4 아군, 2·3·5 상대. 라운드 1: 구매 0~30초, 교전 30초~, 끝 90초. 라운드 2: 100초~ (공수 교대: 시작 자리가 100m 옮겨 감) // 선수 0·1·4 아군, 2·3·5 상대. 라운드 1: 구매 0~30초, 교전 30초~, 끝 90초. 라운드 2: 100초~ (공수 교대: 시작 자리가 100m 옮겨 감)
@@ -180,3 +180,23 @@ test('전략 보기 카메라: 시야각 · 화면비 · 기울기를 넣어 구
assert.ok(edge > 0.84, `너무 멀다 ${edge}`); assert.ok(edge > 0.84, `너무 멀다 ${edge}`);
} }
}); });
test('1인칭 시야: 창이 넓어도 게임처럼 가로 103° · 좁은 창은 게임 세로 시야 · 줌은 배율만큼 좁아진다', () => {
const rad = (d: number) => (d * Math.PI) / 180;
const hfov = (aspect: number, zoom = 1) => (2 * Math.atan(Math.tan(rad(gameFov(aspect, zoom) / 2)) * aspect) * 180) / Math.PI;
// 16:9 = 게임 화면 그대로 (가로 103°, 세로 약 70.5°)
assert.ok(Math.abs(hfov(16 / 9) - 103) < 1e-9);
assert.ok(Math.abs(gameFov(16 / 9) - 70.53) < 0.01);
// 가로로 긴 창 (노트북의 리플레이 창 비율 2.5 등): 가로가 103° 를 넘지 않는다 (예전엔 세로 70° 고정이라 약 120°)
for (const a of [2, 2.5, 3.2]) assert.ok(Math.abs(hfov(a) - 103) < 1e-9, `화면비 ${a}: ${hfov(a)}`);
// 좁은 창: 게임 세로 시야 그대로, 가로는 103° 보다 좁다
for (const a of [1, 1.5]) {
assert.ok(Math.abs(gameFov(a) - gameFov(16 / 9)) < 1e-9);
assert.ok(hfov(a) < 103);
}
// 줌: 화면 가운데 물체가 배율만큼 크게 (tan 이 배율만큼 작아진다)
for (const z of [1.25, 2.5, 5]) {
const k = Math.tan(rad(gameFov(2.5) / 2)) / Math.tan(rad(gameFov(2.5, z) / 2));
assert.ok(Math.abs(k - z) < 1e-9, `배율 ${z}: ${k}`);
}
});

View File

@@ -130,9 +130,11 @@ function timeline(q) {
return { items: page, next: items.length > limit ? enc(page[page.length - 1]) : null }; return { items: page, next: items.length > limit ? enc(page[page.length - 1]) : null };
} }
const hasReplay = (m) => !!m.replayPath && fs.existsSync(m.replayPath);
const summary = (m) => ({ const summary = (m) => ({
id: m.id, game: m.game, startedAt: m.startedAt, endedAt: m.endedAt, map: m.map, mode: m.mode, win: m.win, score: m.score, status: m.status, participants: m.participants, id: m.id, game: m.game, startedAt: m.startedAt, endedAt: m.endedAt, map: m.map, mode: m.mode, win: m.win, score: m.score, status: m.status, participants: m.participants,
source: m.source ?? 'live', voice: m.utterances.length > 0, source: m.source ?? 'live', voice: m.utterances.length > 0,
...(m.game === 'valorant' ? { replay: hasReplay(m) } : {}),
}); });
function userProfile(id) { function userProfile(id) {
@@ -361,8 +363,11 @@ async function handle(req, res) {
// 모드 · 날짜 필터, 데스매치는 늘 뺀다 (v1.11.0 앱과 같게) // 모드 · 날짜 필터, 데스매치는 늘 뺀다 (v1.11.0 앱과 같게)
const mode = q.get('mode'); const mode = q.get('mode');
const after = q.get('after') ? Number(q.get('after')) : 0; const after = q.get('after') ? Number(q.get('after')) : 0;
// 리플레이 필터 (v1.12.0 앱과 같게): 발로란트 경기만
const replay = q.get('replay');
const keepReplay = (x) => (replay === 'yes' || replay === 'no' ? x.game === 'valorant' && hasReplay(x) === (replay === 'yes') : true);
const list = db.matches const list = db.matches
.filter((x) => (!game || x.game === game) && x.startedAt < before && x.startedAt >= after && keep(x) && x.mode !== '데스매치' && (!mode || x.mode === mode)) .filter((x) => (!game || x.game === game) && x.startedAt < before && x.startedAt >= after && keep(x) && keepReplay(x) && x.mode !== '데스매치' && (!mode || x.mode === mode))
.sort((a, b) => b.startedAt - a.startedAt) .sort((a, b) => b.startedAt - a.startedAt)
.slice(0, limit) .slice(0, limit)
.map(summary); .map(summary);

View File

@@ -16,7 +16,7 @@ import CrosshairPanel from './CrosshairPanel';
import { buildAnimIndex, rigInput } from '../lib/replayAnim'; import { buildAnimIndex, rigInput } from '../lib/replayAnim';
import { abilityLook, type AbilityLook } from '../lib/abilities'; import { abilityLook, type AbilityLook } from '../lib/abilities';
import { loadVfxDb, vfxCoverage, VfxObject, type Place, type VfxDb } from '../lib/vfx'; import { loadVfxDb, vfxCoverage, VfxObject, type Place, type VfxDb } from '../lib/vfx';
import { buildDirector, fitDistance, shotIndexAt, SHOT_LABEL } from '../lib/director'; import { buildDirector, fitDistance, gameFov, shotIndexAt, SHOT_LABEL } from '../lib/director';
import { boardIndex } from '../lib/scoreboard'; import { boardIndex } from '../lib/scoreboard';
import ReplayScoreboard from './ReplayScoreboard'; import ReplayScoreboard from './ReplayScoreboard';
@@ -1028,7 +1028,7 @@ export default function ReplayViewer({ m, replay, sync }: Props) {
} }
// 1인칭 팔 · 총: 들고 있는 무기 · 꺼낸 때 · 사격 · 재장전 · 줌 · 걷기 // 1인칭 팔 · 총: 들고 있는 무기 · 꺼낸 때 · 사격 · 재장전 · 줌 · 걷기
const fp = p && !isDead(replay, selIdx, t) ? fpState(selIdx, t) : null; const fp = p && !isDead(replay, selIdx, t) ? fpState(selIdx, t) : null;
const zoomFov = fp ? 70 / (fp.zoom === 0 ? 1 : fp.sniper ? (fp.zoom >= 2 ? 5 : 2.5) : 1.25) : 70; const zoomFov = gameFov(camera.aspect, fp ? (fp.zoom === 0 ? 1 : fp.sniper ? (fp.zoom >= 2 ? 5 : 2.5) : 1.25) : 1);
if (camera.fov !== zoomFov) { if (camera.fov !== zoomFov) {
camera.fov = zoomFov; camera.fov = zoomFov;
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();

View File

@@ -44,6 +44,7 @@ export class ApiError extends Error {
/** 경기 탭 필터 */ /** 경기 탭 필터 */
export type MatchHas = 'timeline' | 'voice'; export type MatchHas = 'timeline' | 'voice';
export type MatchReplay = 'yes' | 'no';
async function request<T>(path: string, init: RequestInit = {}): Promise<T> { async function request<T>(path: string, init: RequestInit = {}): Promise<T> {
let res: Response; let res: Response;
@@ -167,7 +168,8 @@ export const api = {
), ),
// has: timeline = 타임라인에 나오는 경기, voice = 목소리가 녹음된 경기 (v1.9.0 앱부터, 예전 앱은 무시하고 다 보냄) // has: timeline = 타임라인에 나오는 경기, voice = 목소리가 녹음된 경기 (v1.9.0 앱부터, 예전 앱은 무시하고 다 보냄)
// mode · after (v1.11.0 앱부터): 모드 이름("경쟁전") · 이 시각 이후 시작한 경기. 데스매치는 앱이 늘 뺀다 (예전 앱은 사이트가 거름) // mode · after (v1.11.0 앱부터): 모드 이름("경쟁전") · 이 시각 이후 시작한 경기. 데스매치는 앱이 늘 뺀다 (예전 앱은 사이트가 거름)
matches: (o: { game?: GameType; limit?: number; before?: number; after?: number; has?: MatchHas; mode?: string } = {}) => // replay (v1.12.0 앱부터): yes = 게임 PC 에 리플레이 파일이 있는 발로란트 경기, no = 없는 발로란트 경기 (예전 앱은 무시하고 다 보냄)
matches: (o: { game?: GameType; limit?: number; before?: number; after?: number; has?: MatchHas; mode?: string; replay?: MatchReplay } = {}) =>
request<MatchSummary[]>(`/api/matches${qs(o)}`), request<MatchSummary[]>(`/api/matches${qs(o)}`),
/** 경기 탭 모드 필터 목록 (v1.11.0 앱부터, 예전 앱은 404) */ /** 경기 탭 모드 필터 목록 (v1.11.0 앱부터, 예전 앱은 404) */
matchModes: (game?: GameType) => request<{ game: GameType; mode: string; count: number }[]>(`/api/matches/modes${qs({ game })}`), matchModes: (game?: GameType) => request<{ game: GameType; mode: string; count: number }[]>(`/api/matches/modes${qs({ game })}`),

View File

@@ -299,3 +299,17 @@ export function fitDistance(points: V3[], target: V3, dir: V3, fovDeg: number, a
} }
return need; return need;
} }
/** 발로란트 시야: 16:9 화면에서 가로 103° (바꿀 수 없음) */
export const GAME_HFOV = 103;
const GAME_TAN_H = Math.tan(((GAME_HFOV / 2) * Math.PI) / 180);
/**
* 1인칭 세로 시야각(three.js fov). 게임 화면(16:9 · 가로 103°)을 이 창 비율에 꽉 차게 잘라 보여 준다:
* 16:9 보다 넓은 창은 가로 103° 를 지키고(위아래가 잘림), 좁은 창은 게임 세로 시야(약 70.5°)를 지킨다(양옆이 잘림).
* 그래서 어느 창에서도 게임보다 넓게 보이지 않는다. zoom 은 배율 (정조준 1.25 · 저격 2.5 · 5)
*/
export function gameFov(aspect: number, zoom = 1): number {
const tv = GAME_TAN_H / Math.max(aspect, 16 / 9) / zoom;
return (2 * Math.atan(tv) * 180) / Math.PI;
}

View File

@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react';
import { Link, useNavigate, useParams } from 'react-router'; import { Link, useNavigate, useParams } from 'react-router';
import type { GameType, MatchSummary, User, UserProfile } from '@gvr/shared'; import type { GameType, MatchSummary, User, UserProfile } from '@gvr/shared';
import { api, type MatchHas } from '../lib/api'; import { api, type MatchHas, type MatchReplay } from '../lib/api';
import { useStatus } from '../store/app'; import { useStatus } from '../store/app';
import { dateInputToMs, dateInputValue, fmtDuration, fmtDay } from '../lib/format'; import { dateInputToMs, dateInputValue, fmtDuration, fmtDay } from '../lib/format';
import { sfx } from '../lib/sfx'; import { sfx } from '../lib/sfx';
@@ -14,18 +14,21 @@ function useLoad<T>(fn: () => Promise<T>, deps: unknown[]) {
const [data, setData] = useState<T | null>(null); const [data, setData] = useState<T | null>(null);
const [err, setErr] = useState<unknown>(null); const [err, setErr] = useState<unknown>(null);
const [n, setN] = useState(0); const [n, setN] = useState(0);
const [loading, setLoading] = useState(true);
useEffect(() => { useEffect(() => {
let alive = true; let alive = true;
setErr(null); setErr(null);
setLoading(true);
fn() fn()
.then((d) => alive && setData(d)) .then((d) => alive && setData(d))
.catch((e) => alive && setErr(e)); .catch((e) => alive && setErr(e))
.finally(() => alive && setLoading(false));
return () => { return () => {
alive = false; alive = false;
}; };
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [...deps, epoch, n]); }, [...deps, epoch, n]);
return { data, err, retry: () => setN((x) => x + 1) }; return { data, err, loading, retry: () => setN((x) => x + 1) };
} }
export function UsersPage() { export function UsersPage() {
@@ -67,17 +70,19 @@ export function MatchesPage() {
const [game, setGameRaw] = useState<GameType | null>(null); const [game, setGameRaw] = useState<GameType | null>(null);
const [has, setHas] = useState<MatchHas | null>(null); const [has, setHas] = useState<MatchHas | null>(null);
const [mode, setMode] = useState<string | null>(null); const [mode, setMode] = useState<string | null>(null);
const [replay, setReplay] = useState<MatchReplay | null>(null);
// 날짜 (한국 시각): from = 시작 날 0시, to = 끝 날 23:59:59.999 // 날짜 (한국 시각): from = 시작 날 0시, to = 끝 날 23:59:59.999
const [from, setFrom] = useState<number | undefined>(undefined); const [from, setFrom] = useState<number | undefined>(undefined);
const [to, setTo] = useState<number | undefined>(undefined); const [to, setTo] = useState<number | undefined>(undefined);
// 게임을 바꾸면 그 게임에 없을 수 있는 모드는 풀어 준다 // 게임을 바꾸면 그 게임에 없을 수 있는 모드는 풀어 준다 (리플레이 필터는 발로란트만)
const setGame = (g: GameType | null) => { const setGame = (g: GameType | null) => {
setGameRaw(g); setGameRaw(g);
setMode(null); setMode(null);
if (g === 'lol') setReplay(null);
}; };
const nav = useNavigate(); const nav = useNavigate();
const query = { limit: PAGE, game: game ?? undefined, has: has ?? undefined, mode: mode ?? undefined, after: from, before: to === undefined ? undefined : to + 1 }; const query = { limit: PAGE, game: game ?? undefined, has: has ?? undefined, mode: mode ?? undefined, replay: replay ?? undefined, after: from, before: to === undefined ? undefined : to + 1 };
const { data, err, retry } = useLoad<MatchSummary[]>(() => api.matches(query), [game, has, mode, from, to]); const { data, err, loading, retry } = useLoad<MatchSummary[]>(() => api.matches(query), [game, has, mode, replay, from, to]);
// 모드 목록: 예전 앱(404)은 불러온 경기에서 만든다 // 모드 목록: 예전 앱(404)은 불러온 경기에서 만든다
const [modeList, setModeList] = useState<{ mode: string; count: number | null }[] | null>(null); const [modeList, setModeList] = useState<{ mode: string; count: number | null }[] | null>(null);
useEffect(() => { useEffect(() => {
@@ -97,7 +102,12 @@ export function MatchesPage() {
}, [game, data]); }, [game, data]);
// 더 보기: 지난 쪽 경기들 (필터가 바뀌면 처음부터) // 더 보기: 지난 쪽 경기들 (필터가 바뀌면 처음부터)
const [more, setMore] = useState<{ list: MatchSummary[]; done: boolean; busy: boolean; err: unknown }>({ list: [], done: false, busy: false, err: null }); const [more, setMore] = useState<{ list: MatchSummary[]; done: boolean; busy: boolean; err: unknown }>({ list: [], done: false, busy: false, err: null });
useEffect(() => setMore({ list: [], done: false, busy: false, err: null }), [data]); // 세대: 첫 쪽(data)이 바뀌면 올리고, 그 전에 보낸 더 보기 응답은 버린다 (새로고침 · 필터 변경 중 늦게 온 응답이 다시 펼치지 않게)
const moreGen = useRef(0);
useEffect(() => {
moreGen.current++;
setMore({ list: [], done: false, busy: false, err: null });
}, [data]);
const all = useMemo(() => { const all = useMemo(() => {
const seen = new Set<string>(); const seen = new Set<string>();
const out: MatchSummary[] = []; const out: MatchSummary[] = [];
@@ -107,11 +117,13 @@ export function MatchesPage() {
// 예전 앱은 has · 모드 · 날짜를 모르고 다 보낸다: 여기서도 거른다 // 예전 앱은 has · 모드 · 날짜를 모르고 다 보낸다: 여기서도 거른다
if (has === 'voice' && !hasVoice(m)) continue; if (has === 'voice' && !hasVoice(m)) continue;
if (m.mode === HIDDEN_MODE || (mode && m.mode !== mode)) continue; if (m.mode === HIDDEN_MODE || (mode && m.mode !== mode)) continue;
// 리플레이를 모르는(replay 없음) 예전 앱 경기는 리플레이 필터에서 뺀다
if (replay && (m.game !== 'valorant' || m.replay !== (replay === 'yes'))) continue;
if ((from !== undefined && m.startedAt < from) || (to !== undefined && m.startedAt > to)) continue; if ((from !== undefined && m.startedAt < from) || (to !== undefined && m.startedAt > to)) continue;
out.push(m); out.push(m);
} }
return out; return out;
}, [data, more.list, has, mode, from, to]); }, [data, more.list, has, mode, replay, from, to]);
const modes = useMemo(() => { const modes = useMemo(() => {
if (modeList) return modeList; if (modeList) return modeList;
const seen = [...new Set([...(data ?? []), ...more.list].filter((m) => !game || m.game === game).map((m) => m.mode))]; const seen = [...new Set([...(data ?? []), ...more.list].filter((m) => !game || m.game === game).map((m) => m.mode))];
@@ -121,13 +133,16 @@ export function MatchesPage() {
const loadMore = () => { const loadMore = () => {
const last = more.list[more.list.length - 1] ?? data?.[data.length - 1]; const last = more.list[more.list.length - 1] ?? data?.[data.length - 1];
if (!last || more.busy) return; if (!last || more.busy) return;
const gen = moreGen.current;
setMore((s) => ({ ...s, busy: true, err: null })); setMore((s) => ({ ...s, busy: true, err: null }));
api api
.matches({ ...query, before: last.startedAt }) .matches({ ...query, before: last.startedAt })
.then((r) => setMore((s) => ({ list: [...s.list, ...r], done: r.length < PAGE, busy: false, err: null }))) .then((r) => gen === moreGen.current && setMore((s) => ({ list: [...s.list, ...r], done: r.length < PAGE, busy: false, err: null })))
.catch((e) => setMore((s) => ({ ...s, busy: false, err: e }))); .catch((e) => gen === moreGen.current && setMore((s) => ({ ...s, busy: false, err: e })));
}; };
const filtered = !!mode || from !== undefined || to !== undefined; const filtered = !!mode || !!replay || from !== undefined || to !== undefined;
// 예전 앱(v1.11 이하)은 리플레이를 몰라 리플레이 필터가 되지 않는다
const replayUnknown = !!replay && !!data?.length && data.every((m) => m.replay === undefined);
const groups = useMemo(() => { const groups = useMemo(() => {
const g = new Map<string, MatchSummary[]>(); const g = new Map<string, MatchSummary[]>();
for (const m of all) { for (const m of all) {
@@ -141,6 +156,10 @@ export function MatchesPage() {
<div className="page-h-row"> <div className="page-h-row">
<h2 className="page-h h">경기</h2> <h2 className="page-h h">경기</h2>
<div className="chips-wrap"> <div className="chips-wrap">
{/* 새로고침: 지금 필터로 첫 쪽부터 다시 받는다 (모드 목록도 data 를 따라 다시 받음) */}
<button className="mini-btn" onClick={retry} disabled={loading} title="경기 목록 새로고침">
{loading ? '불러오는 중…' : '↻ 새로고침'}
</button>
<button className={`chip${!game ? ' on' : ''}`} onClick={() => setGame(null)}> <button className={`chip${!game ? ' on' : ''}`} onClick={() => setGame(null)}>
전체 전체
</button> </button>
@@ -170,6 +189,13 @@ export function MatchesPage() {
</option> </option>
))} ))}
</select> </select>
{game !== 'lol' && (
<select className="mf-sel" value={replay ?? ''} onChange={(e) => setReplay((e.target.value || null) as MatchReplay | null)} aria-label="리플레이" title="게임 PC 에 발로란트 리플레이 파일을 내려받았는지">
<option value="">리플레이 상관없음</option>
<option value="yes">리플레이 있는 경기</option>
<option value="no">리플레이 없는 경기</option>
</select>
)}
<div className="dates mf-dates"> <div className="dates mf-dates">
<input type="date" value={dateInputValue(from)} max={dateInputValue(to)} onChange={(e) => setFrom(dateInputToMs(e.target.value))} aria-label="시작 날짜" /> <input type="date" value={dateInputValue(from)} max={dateInputValue(to)} onChange={(e) => setFrom(dateInputToMs(e.target.value))} aria-label="시작 날짜" />
<span className="dim">~</span> <span className="dim">~</span>
@@ -180,11 +206,12 @@ export function MatchesPage() {
className="link-btn" className="link-btn"
onClick={() => { onClick={() => {
setMode(null); setMode(null);
setReplay(null);
setFrom(undefined); setFrom(undefined);
setTo(undefined); setTo(undefined);
}} }}
> >
모드 · 날짜 초기화 필터 초기화
</button> </button>
)} )}
</div> </div>
@@ -194,8 +221,10 @@ export function MatchesPage() {
{!data && !err && <Spinner label="경기 목록 불러오는 중" />} {!data && !err && <Spinner label="경기 목록 불러오는 중" />}
{data && all.length === 0 && ( {data && all.length === 0 && (
<div className="empty"> <div className="empty">
{filtered {replayUnknown
? '고른 모드 · 날짜에 맞는 경기가 없습니다.' ? '리플레이 필터는 게임 PC 앱 v1.12.0 부터 됩니다. 앱을 업데이트해 주세요.'
: filtered
? '고른 필터에 맞는 경기가 없습니다.'
: has === 'voice' : has === 'voice'
? '목소리가 녹음된 경기가 없습니다.' ? '목소리가 녹음된 경기가 없습니다.'
: has === 'timeline' : has === 'timeline'

View File

@@ -2,7 +2,7 @@
# ValorantReplayParser (MIT, https://github.com/michel-giehl/ValorantReplayParser) 를 고정 커밋으로 받아 vendor/ 에 둔다. # ValorantReplayParser (MIT, https://github.com/michel-giehl/ValorantReplayParser) 를 고정 커밋으로 받아 vendor/ 에 둔다.
# 발로란트 패치로 리플레이 형식이 바뀌면 PARSER_COMMIT 을 새 커밋으로 올린다. # 발로란트 패치로 리플레이 형식이 바뀌면 PARSER_COMMIT 을 새 커밋으로 올린다.
set -euo pipefail set -euo pipefail
PARSER_COMMIT="${PARSER_COMMIT:-28e24af44f5d2e2444fb679f500b6ec04ab60672}" PARSER_COMMIT="${PARSER_COMMIT:-fbf24b62c5a8b8b7a64df71b4cbaaf0a651ce5b8}"
here="$(cd "$(dirname "$0")" && pwd)" here="$(cd "$(dirname "$0")" && pwd)"
dst="$here/vendor/ValorantReplayParser" dst="$here/vendor/ValorantReplayParser"
if [ ! -d "$dst/.git" ]; then if [ ! -d "$dst/.git" ]; then

View File

@@ -512,6 +512,8 @@ public sealed partial class Collector(int sampleMs) : IReplayEventSink
var equipKindIndex = new Dictionary<string, int>(); var equipKindIndex = new Dictionary<string, int>();
int EquipKind(string name) int EquipKind(string name)
{ {
// 밴딧: 파서가 fbf24b6 부터 "Bandit" 이라 부른다. 사이트 · 뽑아 둔 총 모델(map-extract)은 "Compact Pistol" 이라 예전 이름 그대로 낸다
if (name == "Bandit") name = "Compact Pistol";
if (!equipKindIndex.TryGetValue(name, out var k)) { k = equipKinds.Count; equipKinds.Add(name); equipKindIndex[name] = k; } if (!equipKindIndex.TryGetValue(name, out var k)) { k = equipKinds.Count; equipKinds.Add(name); equipKindIndex[name] = k; }
return k; return k;
} }