- 변환기 Crosshair.cs: BombPlayerState 에 복제된 선수 조준점 프로필(주 · 정조준 · 저격 점 · 이름)을 두 번째 읽기로 읽어 players[].crosshair (바뀐 시각마다 전체 설정). 첫 읽기 필드 목록으로 번호를 찾고 패치로 밀려도 이름이 맞는 자리를 찾는다. --fields 디버그, --self-test 에 자리 찾기 · 기본색 검사 - 사이트 lib/crosshair.ts 그리기 · 발로란트 조준점 코드 읽기, CrosshairPanel: 선수 조준점(없으면 내 조준점) / 모든 선수에 내 조준점, 직접 고치기 · 코드 가져오기 · 선수 조준점 복사 - 1인칭: 정조준 조준점 · 저격 조준경 가운데 점 · 사격/이동 오차로 벌어짐 - 앱 1.8.2 (버전이 바뀌면 리플레이를 다시 변환해 조준점이 생긴다) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
4.8 KiB
C#
103 lines
4.8 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace GvrReplay;
|
|
|
|
// 사이트로 가는 형식. 시간은 모두 리플레이 시작부터 ms (t), 좌표는 게임 월드 단위(cm) 정수
|
|
public sealed class ReplayFile
|
|
{
|
|
public string Format { get; set; } = "gvr-replay";
|
|
/// 2: objects 에 yaw · pitch, objectPaths · track.f · states · hits · plants · actions · kills 4번째 열 추가 (v1 열은 그대로)
|
|
public int V { get; set; } = 2;
|
|
public string? MatchId { get; set; }
|
|
public string? Map { get; set; }
|
|
public string? Build { get; set; }
|
|
/// 리플레이 녹화 시작 시각 (서버 기준 유닉스 ms). t 를 실제 시각으로 바꿀 때 recordedAt + t
|
|
public long RecordedAt { get; set; }
|
|
public int DurationMs { get; set; }
|
|
public int SampleMs { get; set; }
|
|
public List<ReplayPlayer> Players { get; set; } = [];
|
|
public List<ReplayRound> Rounds { get; set; } = [];
|
|
/// [t, phase] 게임 단계 바뀜 (원본 값)
|
|
public List<int[]> Phases { get; set; } = [];
|
|
/// [t, killer, victim, deathAnim] (선수 번호, 모르면 -1. deathAnim = deathAnims 번호, 모르면 -1)
|
|
public List<int[]> Kills { get; set; } = [];
|
|
/// 죽는 모션 이름 (예: TP_Core_Death_Head_Front_SM_Montage)
|
|
public List<string> DeathAnims { get; set; } = [];
|
|
/// [t, player, x, y, z, yaw, pitch] 사격 위치와 방향
|
|
public List<int[]> Shots { get; set; } = [];
|
|
/// 스킬 · 설치물 [t0, t1, kind 번호, x, y, z, player, yaw, pitch] (t1 = 사라진 시각, 날아가는 것은 부딪힌 시각, 모르면 -1. yaw · pitch 는 생길 때 방향(도))
|
|
public List<int[]> Objects { get; set; } = [];
|
|
public List<string> ObjectKinds { get; set; } = [];
|
|
/// 움직이는 스킬의 경로 (투사체 비행 · 드론 · 분신). o = objects 번호
|
|
public List<ObjectPath> ObjectPaths { get; set; } = [];
|
|
/// 무기 · 스킬 상태 바뀜 [t, player, equipKind, stateKind] (FiringState · ReloadState · ZoomStateLevel1 · EquipState …)
|
|
public List<int[]> States { get; set; } = [];
|
|
public List<string> StateKinds { get; set; } = [];
|
|
/// 맞은 것 [t, attacker, victim, 쏜 x, y, z, 맞은 x, y, z, 부위(1 머리 · 2 몸 · 3 다리 · 0 모름), 죽였으면 1]
|
|
public List<int[]> Hits { get; set; } = [];
|
|
/// 스파이크 설치 [t, player, x, y, z]
|
|
public List<int[]> Plants { get; set; } = [];
|
|
/// 이어지는 동작 [t0, t1, player, actionKind] (Plant 설치 중 · Defuse 해체 중 · Rope 줄 타기), t1 모르면 -1
|
|
public List<int[]> Actions { get; set; } = [];
|
|
public List<string> ActionKinds { get; set; } = [];
|
|
/// 들고 있는 것이 바뀐 시각 [t, player, kind 번호]. 총은 영어 이름(Vandal 등), 칼은 Melee, 스파이크는 Spike, 스킬은 클래스 이름
|
|
public List<int[]> Equips { get; set; } = [];
|
|
public List<string> EquipKinds { get; set; } = [];
|
|
}
|
|
|
|
public sealed class ReplayPlayer
|
|
{
|
|
public string? Puuid { get; set; }
|
|
/// 캐릭터 클래스 (예: Wushu_PC_C). 요원 이름은 사이트가 경기 상세(match-details)로 붙인다
|
|
public string? Character { get; set; }
|
|
/// 이동 기록. 열 별 배열 (같은 길이): t, x, y, z, yaw(도), pitch(도)
|
|
public PlayerTrack Track { get; set; } = new();
|
|
/// 조준점 설정이 바뀐 시각마다 전체 설정 (시간 순). 리플레이에 없으면 null
|
|
public List<CrosshairAt>? Crosshair { get; set; }
|
|
}
|
|
|
|
public sealed class PlayerTrack
|
|
{
|
|
public List<int> T { get; set; } = [];
|
|
public List<int> X { get; set; } = [];
|
|
public List<int> Y { get; set; } = [];
|
|
public List<int> Z { get; set; } = [];
|
|
public List<int> Yaw { get; set; } = [];
|
|
public List<int> Pitch { get; set; } = [];
|
|
/// 움직임 상태 비트: 1 앉음 · 2 걷기(Shift) · 4 공중(점프 · 떨어짐) · 8 날기(제트 대시 등)
|
|
public List<int> F { get; set; } = [];
|
|
}
|
|
|
|
public sealed class ObjectPath
|
|
{
|
|
public int O { get; set; }
|
|
public List<int> T { get; set; } = [];
|
|
public List<int> X { get; set; } = [];
|
|
public List<int> Y { get; set; } = [];
|
|
public List<int> Z { get; set; } = [];
|
|
/// 드론 · 분신만 (보는 방향, 도). 투사체는 빈 배열
|
|
public List<int> Yaw { get; set; } = [];
|
|
}
|
|
|
|
public sealed class ReplayRound
|
|
{
|
|
/// 1부터
|
|
public int Num { get; set; }
|
|
/// 구매 단계 시작
|
|
public int Buy { get; set; }
|
|
/// 교전 시작 (구매 단계 끝), 모르면 -1
|
|
public int Combat { get; set; }
|
|
/// 라운드 끝 (승패 확정), 모르면 -1
|
|
public int End { get; set; }
|
|
}
|
|
|
|
public static class ReplayJson
|
|
{
|
|
public static readonly JsonSerializerOptions Options = new()
|
|
{
|
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
|
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
|
|
};
|
|
}
|