diff --git a/README.md b/README.md index bac69a1..249f764 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ - 앱은 시작할 때와 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.5.0 바뀐 점 + +- **3D 리플레이**: 발로란트 경력 탭에서 경기 리플레이를 내려받아 두면, 사이트 경기 화면 "3D 리플레이"를 열 때 게임 PC 앱이 `%LOCALAPPDATA%\VALORANT\Saved` 아래 `<경기 ID>.vrf` 를 찾아 변환해 보낸다 (처음 한 번 10초 안팎, 그 뒤로는 `GVR-Data/replays/<경기 ID>.json.gz` 보관본). 선수 10명이 3D 맵 위에서 움직이고 그때 대화가 같이 재생된다 + - 변환기 `resources/replay/gvr-replay.exe` (`tools/replay-extract`, .NET 단일 파일). 한 번에 하나 · 낮은 우선순위로 돌린다. 실패하면 이유를 사이트에 보여 주고, 같은 파일은 다시 내려받을 때까지 다시 하지 않는다 + - 앱 `app/src/core/replays.ts`, API `GET /api/matches/:id/replay` (gzip JSON, 변환 중 202) · `GET /api/replays` (찾은 리플레이 목록) + ## v1.4.3 바뀐 점 - 상대 닉네임을 말로 적던 문제 (예: 말소리가 "QQQWWWQ"로 나옴): 그 경기 선수 이름을 모두 핫워드로 넣어서, 말을 못 알아들으면 Whisper 가 닉네임을 그대로 적었다. 이제 diff --git a/docs/dev/replay-3d.md b/docs/dev/replay-3d.md index 3d6e7c4..1c9a811 100644 --- a/docs/dev/replay-3d.md +++ b/docs/dev/replay-3d.md @@ -23,10 +23,14 @@ - 천장 자르기: 자동(고른 선수 · 없으면 가장 높은 산 선수 몸 중심 + 380cm 위를 자름) · 없음 · 직접(슬라이더). - 자동 갱신: `scripts/install.sh` 가 `~/gvr-maps` 에 설치, `gvr-maps-update.timer` 30분마다 `update.sh`: uedb 매핑(버전 · 갱신 시각) 또는 라이브 매니페스트가 바뀌면 매핑을 받아 `~/gvr-maps/mappings/` + nextcloud `claude/game-voice-recorder/valorant/mappings/` 에 보관 → 전체 추출 → .5 `data/maps3d` 에 올리고 index.json 교체 (이전 폴더 1개만 남김). 어느 단계든 실패하면 이전 맵 유지, 같은 조합은 30분 · 1 · 2 · 4 · 6시간 간격으로 재시도 (첫 실패 · 성공 때 이 방 채널에 한 줄 알림, uedb/패치 확인 자체는 6번 연속 실패 때 알림). 지금 사이트에 있는 맵이 하나라도 새 결과에 없으면 올리지 않는다 (추출기도 맵 찾기 중 레벨 읽기 실패를 실패로 친다). 강제(대기 · 누락 검사 무시): `~/gvr-maps/scripts/update.sh --force`. 시험: `scripts/test-update.sh`. +## 앱 (v1.5.0) +- `app/src/core/replays.ts`: `%LOCALAPPDATA%\VALORANT\Saved` 아래(깊이 3, Logs · Crashes · Config 제외) `<경기 ID>.vrf` → 사이트가 열 때 `gvr-replay.exe ` (낮은 우선순위, 한 번에 하나, 3분 제한) → gzip → `GVR-Data/replays/<경기 ID>.json.gz` + `.src`(크기:수정시각:앱 버전). 실패는 메모리에 기억 (파일이 바뀌거나 앱을 다시 켜면 다시) +- `GET /api/matches/:id/replay`: 15초 안에 끝나면 200 (content-encoding gzip), 아니면 202 `{status:'converting'}` → 사이트가 3초마다 다시. 중계는 content-encoding 이 있으면 바이너리 조각 (`relay/client.ts`) +- 빌드: win-ci `replay_build` 단계 (.NET 10 SDK `C:\win-ci\dotnet`, `dotnet publish -r win-x64` 단일 파일 38MB) → electron-builder extraResources `replay/`. 호스트 `~/win-ci/serve/gvr-test.vrf`(13.08 어비스 경기) 가 있으면 변환기 · 포터블 앱 smoke(`GVR_SMOKE_VRF`) 둘 다 실제 변환 +- 리눅스 실측(13.08, 73.8MB vrf): 5.5초, 최대 메모리 347MB, gzip 1.4MB + ## 남은 일 -1. 앱: `%LOCALAPPDATA%\VALORANT\Saved` 아래 `.vrf` 찾기 → `gvr-replay.exe` 실행 → `GVR-Data/replays/.json.gz` → `GET /api/matches/:id/replay` (content-encoding gzip, 사이트는 /api/* 그대로 중계) -2. 빌드: win-ci 에 .NET SDK 설치 · `dotnet publish -r win-x64` 단일 파일 → electron-builder extraResources `replay/` -3. 실제 경기로 동기화 오차 확인 (사이트 아래 줄 "킬 N개로 맞춤 (최대 오차 X초)") +- 실제 경기로 동기화 오차 확인 (사이트 아래 줄 "킬 N개로 맞춤 (최대 오차 X초)") ## 완전 3D (맵 · 캐릭터 · 총 · 효과) 조사 (2026-10-17) - 게임 파일: Riot CDN 에서 바로 받을 수 있다 (게임 PC 불필요). 매니페스트는 diff --git a/site/web/src/components/ReplayPanel.tsx b/site/web/src/components/ReplayPanel.tsx index e0d0ddb..19c4a2c 100644 --- a/site/web/src/components/ReplayPanel.tsx +++ b/site/web/src/components/ReplayPanel.tsx @@ -2,6 +2,7 @@ import { lazy, Suspense, useEffect, useMemo, useState } from 'react'; import type { MatchDetail } from '@gvr/shared'; import { api, ApiError } from '../lib/api'; import { computeSync, type ReplayFile } from '../lib/replay'; +import { reportClient } from '../lib/report'; import { Panel, Spinner } from './common'; // three.js 는 크므로 3D 리플레이를 열 때만 받는다 @@ -37,6 +38,8 @@ export function ReplayPanel({ m }: { m: MatchDetail }) { if (!alive) return; setConverting(false); setErr(e); + // 변환 실패 이유는 게임 PC 에만 남으므로 사이트 로그에도 남긴다 + if (e instanceof ApiError && e.status === 422) reportClient('warn', `리플레이 변환 실패 ${m.id}: ${e.detail ?? e.code}`); }); void ask(0); return () => { @@ -70,7 +73,7 @@ export function ReplayPanel({ m }: { m: MatchDetail }) { ) : appTooOld ? (
지금 게임 PC 앱 버전은 아직 리플레이를 보내지 않습니다. 리플레이 자동 변환이 들어간 앱으로 업데이트하면 볼 수 있습니다.
) : failed ? ( -
게임 PC 가 이 경기 리플레이를 변환하지 못했습니다. 발로란트 패치로 리플레이 형식이 바뀌었을 수 있습니다 (게임 PC 앱 로그에 이유가 남습니다).
+
게임 PC 가 이 경기 리플레이를 변환하지 못했습니다. 발로란트 패치로 리플레이 형식이 바뀌었을 수 있습니다. ({(err as ApiError).detail ?? '이유 모름'})
) : err ? (
리플레이를 불러오지 못했습니다: {err instanceof Error ? err.message : String(err)}
) : !replay || !sync ? ( diff --git a/site/web/src/lib/api.ts b/site/web/src/lib/api.ts index e52f177..1537fa9 100644 --- a/site/web/src/lib/api.ts +++ b/site/web/src/lib/api.ts @@ -33,6 +33,8 @@ export class ApiError extends Error { constructor( public status: number, public code: string, + /** 서버가 함께 보낸 설명 (있으면) */ + public detail?: string, ) { super(`${status} ${code}`); } @@ -54,8 +56,11 @@ async function request(path: string, init: RequestInit = {}): Promise { return (await res.json()) as T; } let code = 'error'; + let detail: string | undefined; try { - code = ((await res.json()) as { error?: string }).error ?? code; + const b = (await res.json()) as { error?: string; message?: string }; + code = b.error ?? code; + if (typeof b.message === 'string') detail = b.message; } catch { /* 본문 없음 */ } @@ -64,7 +69,7 @@ async function request(path: string, init: RequestInit = {}): Promise { else if (res.status === 503 && code === 'device_offline') emit('device_offline'); // 게임 PC 쪽 오류 · 시간 초과는 사이트 로그에도 남긴다 (게임 PC 꺼짐은 서버가 이미 남김) else if (res.status >= 500) reportClient('error', `요청 실패 ${res.status} ${code}: ${init.method ?? 'GET'} ${path.split('?')[0]}`); - throw new ApiError(res.status, code); + throw new ApiError(res.status, code, detail); } export interface Me {