1
0
Fork 0
forked from aly/qstbak

muffin v7.5.11

This commit is contained in:
alydev 2026-08-17 20:29:32 +10:00
parent addf2d530f
commit 3102923ce2
522 changed files with 41082 additions and 211592 deletions

View file

@ -0,0 +1,42 @@
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Questionable.LgbWorker;
internal sealed class LgbWorkerManifest
{
[JsonPropertyName("sqpackPath")]
public string SqpackPath { get; set; } = string.Empty;
[JsonPropertyName("gameVersion")]
public string GameVersion { get; set; } = string.Empty;
[JsonPropertyName("npcCachePath")]
public string NpcCachePath { get; set; } = string.Empty;
[JsonPropertyName("boundaryCachePath")]
public string BoundaryCachePath { get; set; } = string.Empty;
[JsonPropertyName("territories")]
public List<TerritoryEntry> Territories { get; set; } = new List<TerritoryEntry>();
[JsonPropertyName("levelEntries")]
public List<LevelEntry> LevelEntries { get; set; } = new List<LevelEntry>();
public static LgbWorkerManifest Load(string path)
{
using FileStream utf8Json = File.OpenRead(path);
LgbWorkerManifest? obj = JsonSerializer.Deserialize<LgbWorkerManifest>(utf8Json) ?? throw new InvalidDataException("Manifest deserialized to null");
if (string.IsNullOrWhiteSpace(obj.SqpackPath))
{
throw new InvalidDataException("SqpackPath is missing");
}
if (string.IsNullOrWhiteSpace(obj.GameVersion))
{
throw new InvalidDataException("GameVersion is missing");
}
return obj;
}
}