using System.Text.Json; using System.Text.Json.Serialization; namespace XFEWarframe.Client; public sealed record GameInstallation(string Directory, string Version, string Source); public sealed record SignatureResult(string Name, int Expected, int Found, int[] Rvas, string Detail, bool Required = true); public sealed class CompatibilityReport { public string Executable { get; set; } = ""; public string Version { get; set; } = ""; public string Sha256 { get; set; } = ""; public string Profile { get; set; } = "modern-x64-v1"; public string ValidationScope { get; set; } = "static-signatures"; public bool Compatible { get; set; } public bool ExperimentalMultiAbilities { get; set; } public bool ExperimentalLua { get; set; } public bool ExperimentalFetch { get; set; } public bool ExperimentalCardRendering { get; set; } public bool AirSlideHeavyAttacks { get; set; } public List Checks { get; set; } = []; public Dictionary Addresses { get; set; } = []; public Dictionary Prologues { get; set; } = []; public List Problems { get; set; } = []; public List Warnings { get; set; } = []; } public sealed class ClientConfiguration { public string Language { get; set; } = "zh"; public bool DirectX12 { get; set; } public bool RestoreAirSlideHeavyAttacks { get; set; } = true; public int SchemaVersion { get; set; } = 1; public bool EnableGameTestControl { get; set; } public string ServerUrl { get; set; } = "http://127.0.0.1:8444"; public string GameServerUrl { get; set; } = ""; public string ServerName { get; set; } = "XFEWarframe"; public string BuildLabel { get; set; } = ""; public string GameSha256 { get; set; } = ""; public string InstallationId { get; set; } = ""; public Dictionary Addresses { get; set; } = []; public Dictionary Prologues { get; set; } = []; } public sealed class PayloadManifest { public int SchemaVersion { get; set; } = 1; public string Version { get; set; } = "1.0.0"; public string Sha256 { get; set; } = ""; } public sealed record BackupEntry(string FileName, string BackupName, string Sha256); public sealed class InstallationState { public int SchemaVersion { get; set; } = 1; public string Version { get; set; } = ""; public string GameSha256 { get; set; } = ""; public Dictionary Files { get; set; } = []; public List LegacyFiles { get; set; } = []; public DateTimeOffset InstalledAt { get; set; } } public sealed class PlayerSettings { public string GameDirectory { get; set; } = ""; public string ServerUrl { get; set; } = "http://127.0.0.1:8444"; } public sealed record FileChange(string Path, string? Backup, string? BeforeHash, string? AfterHash); public sealed class TransactionJournal { public int SchemaVersion { get; set; } = 1; public List Changes { get; set; } = []; } [JsonSourceGenerationOptions(WriteIndented = true, PropertyNameCaseInsensitive = true)] [JsonSerializable(typeof(CompatibilityReport))] [JsonSerializable(typeof(ClientConfiguration))] [JsonSerializable(typeof(GameExitRecord))] [JsonSerializable(typeof(ServerDescription))] [JsonSerializable(typeof(PayloadManifest))] [JsonSerializable(typeof(InstallationState))] [JsonSerializable(typeof(PlayerSettings))] [JsonSerializable(typeof(TransactionJournal))] [JsonSerializable(typeof(List))] public partial class ClientJson : JsonSerializerContext;