2024-12-22 16:38:47 +03:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
2025-01-05 17:05:23 +03:00
|
|
|
namespace Nebula.Shared.Models;
|
2024-12-22 16:38:47 +03:00
|
|
|
|
2024-12-27 19:15:33 +03:00
|
|
|
public sealed record AuthInfo(
|
|
|
|
|
[property: JsonPropertyName("mode")] string Mode,
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("public_key")]
|
|
|
|
|
string PublicKey);
|
2024-12-22 16:38:47 +03:00
|
|
|
|
2024-12-22 21:38:19 +03:00
|
|
|
public sealed record BuildInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("engine_version")]
|
|
|
|
|
string EngineVersion,
|
|
|
|
|
[property: JsonPropertyName("fork_id")]
|
|
|
|
|
string ForkId,
|
|
|
|
|
[property: JsonPropertyName("version")]
|
|
|
|
|
string Version,
|
|
|
|
|
[property: JsonPropertyName("download_url")]
|
|
|
|
|
string DownloadUrl,
|
|
|
|
|
[property: JsonPropertyName("manifest_download_url")]
|
|
|
|
|
string ManifestDownloadUrl,
|
|
|
|
|
[property: JsonPropertyName("manifest_url")]
|
|
|
|
|
string ManifestUrl,
|
2024-12-27 19:15:33 +03:00
|
|
|
[property: JsonPropertyName("acz")] bool Acz,
|
|
|
|
|
[property: JsonPropertyName("hash")] string Hash,
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("manifest_hash")]
|
|
|
|
|
string ManifestHash);
|
2024-12-27 19:15:33 +03:00
|
|
|
|
|
|
|
|
public sealed record ServerLink(
|
|
|
|
|
[property: JsonPropertyName("name")] string Name,
|
|
|
|
|
[property: JsonPropertyName("icon")] string Icon,
|
|
|
|
|
[property: JsonPropertyName("url")] string Url);
|
|
|
|
|
|
|
|
|
|
public sealed record ServerInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("connect_address")]
|
|
|
|
|
string ConnectAddress,
|
2024-12-27 19:15:33 +03:00
|
|
|
[property: JsonPropertyName("auth")] AuthInfo Auth,
|
|
|
|
|
[property: JsonPropertyName("build")] BuildInfo Build,
|
|
|
|
|
[property: JsonPropertyName("desc")] string Desc,
|
2025-07-02 21:32:51 +03:00
|
|
|
[property: JsonPropertyName("links")] List<ServerLink>? Links);
|
2024-12-22 16:38:47 +03:00
|
|
|
|
2024-12-22 21:38:19 +03:00
|
|
|
public sealed record EngineVersionInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("insecure")]
|
|
|
|
|
bool Insecure,
|
|
|
|
|
[property: JsonPropertyName("redirect")]
|
|
|
|
|
string? RedirectVersion,
|
|
|
|
|
[property: JsonPropertyName("platforms")]
|
|
|
|
|
Dictionary<string, EngineBuildInfo> Platforms);
|
2024-12-22 16:38:47 +03:00
|
|
|
|
2024-12-22 21:38:19 +03:00
|
|
|
public sealed class EngineBuildInfo
|
2024-12-22 16:38:47 +03:00
|
|
|
{
|
|
|
|
|
[JsonInclude] [JsonPropertyName("sha256")]
|
|
|
|
|
public string Sha256 = default!;
|
|
|
|
|
|
|
|
|
|
[JsonInclude] [JsonPropertyName("sig")]
|
|
|
|
|
public string Signature = default!;
|
|
|
|
|
|
|
|
|
|
[JsonInclude] [JsonPropertyName("url")]
|
|
|
|
|
public string Url = default!;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-27 19:15:33 +03:00
|
|
|
public sealed record ServerHubInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("address")]
|
|
|
|
|
string Address,
|
|
|
|
|
[property: JsonPropertyName("statusData")]
|
|
|
|
|
ServerStatus StatusData,
|
|
|
|
|
[property: JsonPropertyName("inferredTags")]
|
|
|
|
|
List<string> InferredTags);
|
2024-12-22 16:38:47 +03:00
|
|
|
|
2024-12-22 21:38:19 +03:00
|
|
|
public sealed record ServerStatus(
|
2024-12-27 19:15:33 +03:00
|
|
|
[property: JsonPropertyName("map")] string Map,
|
|
|
|
|
[property: JsonPropertyName("name")] string Name,
|
|
|
|
|
[property: JsonPropertyName("tags")] List<string> Tags,
|
|
|
|
|
[property: JsonPropertyName("preset")] string Preset,
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("players")]
|
|
|
|
|
int Players,
|
|
|
|
|
[property: JsonPropertyName("round_id")]
|
|
|
|
|
int RoundId,
|
|
|
|
|
[property: JsonPropertyName("run_level")]
|
|
|
|
|
int RunLevel,
|
|
|
|
|
[property: JsonPropertyName("panic_bunker")]
|
|
|
|
|
bool PanicBunker,
|
|
|
|
|
[property: JsonPropertyName("round_start_time")]
|
|
|
|
|
DateTime? RoundStartTime,
|
|
|
|
|
[property: JsonPropertyName("soft_max_players")]
|
|
|
|
|
int SoftMaxPlayers);
|
2024-12-27 19:15:33 +03:00
|
|
|
|
|
|
|
|
public sealed record ModulesInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("modules")]
|
|
|
|
|
Dictionary<string, Module> Modules);
|
2024-12-27 19:15:33 +03:00
|
|
|
|
|
|
|
|
public sealed record Module(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("versions")]
|
|
|
|
|
Dictionary<string, ModuleVersionInfo> Versions);
|
2024-12-27 19:15:33 +03:00
|
|
|
|
|
|
|
|
public sealed record ModuleVersionInfo(
|
2025-01-14 22:10:16 +03:00
|
|
|
[property: JsonPropertyName("platforms")]
|
|
|
|
|
Dictionary<string, EngineBuildInfo> Platforms);
|