Class WorldDump
- Namespace
- Valheim.Testing.GameSessions
- Assembly
- Valheim.Testing.GameSessions.dll
The one owner of "a ValheimCLI world dump becomes a pinned offline input". CaptureAsync(GameActor, IGameHost, string, string, int, (float X, float Z, float Radius)?, string, string, TimeSpan, CancellationToken) runs the dump
through a pinned GameActor, checks the game's reply against the file it fetched, and writes
<name>.csv and its WorldDumpManifest as <name>.json. Offline tests load the pair
with ReadManifest(string) and Verify() or Load(IEnumerable<WorldDumpManifest>, string),
which check the file against the manifest; the reply grammar is read only here.
public static class WorldDump
- Inheritance
-
objectWorldDump
Methods
CaptureAsync(GameActor, IGameHost, string, string, int, (float X, float Z, float Radius)?, string, string, TimeSpan, CancellationToken)
Captures one dump. The actor must be pinned and allowed to run the cheat-gated dump command (see
TestAccess); the dump runs within the actor's CommandTimeout, so raise it for
a large dump. The whole host directory is fetched, so give each capture a new, absolute one. Reads cli_world before and after the dump and refuses a change of world;
runs cli_world_dump <step> <hostDirectory>, with --window x,z,radius when
window is given; requires one complete OK: WORLD_DUMP reply whose step, sample count,
window (to the metre) and extent agree with the fetched file and whose file lies in hostDirectory; then
writes the CSV and manifest into localDirectory without replacing either. On any failure
neither file is left behind. Returns the manifest with Path set to the local CSV.
public static Task<WorldDumpManifest> CaptureAsync(GameActor actor, IGameHost host, string hostDirectory, string name, int step, (float X, float Z, float Radius)? window, string gameBuild, string localDirectory, TimeSpan fetchTimeout, CancellationToken cancellation = default)
Parameters
actorGameActorhostIGameHosthostDirectorystringnamestringstepintwindow(float X, float Y, float Z)?gameBuildstringThe game build the caller pinned for this host (the dump does not report it).
localDirectorystringfetchTimeoutTimeSpancancellationCancellationToken
Returns
- Task<WorldDumpManifest>
ReadManifest(string)
Reads a manifest CaptureAsync(GameActor, IGameHost, string, string, int, (float X, float Z, float Radius)?, string, string, TimeSpan, CancellationToken) wrote. A relative Path resolves against the manifest's own directory, so a CSV and manifest can move together. Nothing is verified until Verify() or Load(IEnumerable<WorldDumpManifest>, string).
public static WorldDumpManifest ReadManifest(string path)
Parameters
pathstring