Table of Contents

Class OwnedCopies

Namespace
Valheim.Testing.GameSessions
Assembly
Valheim.Testing.GameSessions.dll

Finds and removes the copies runs leave behind. A copy is recognised only by what WorldFixture writes: a directory named valheim-test- and 32 hex digits holding fixture-provenance.json, the manifest of what was copied into it. Nothing else under a root is ever listed or removed, and links are never followed. Find(string) only reads. Remove(string, bool) takes one copy at a time by path, refuses one a running process uses and refuses a world copy (a run's save) unless asked, and keeps what the run changed in the copy beside it (Retire(string, long, long)).

public static class OwnedCopies
Inheritance
object
OwnedCopies

Methods

Find(string)

Every owned copy under root, largest first. Reads only.

public static IReadOnlyList<OwnedCopy> Find(string root)

Parameters

root string

Returns

IReadOnlyList<OwnedCopy>

Remove(string, bool)

Removes one owned copy, keeping every file its run added or changed in <copy>-changes beside it (with changes.json). Refuses a path that is not an owned copy, one a running process uses, and a world copy unless allowWorld. A copy whose run did not pass keeps larger files (PinnedServerRun's failure limits).

public static RetiredCopy Remove(string path, bool allowWorld = false)

Parameters

path string
allowWorld bool

Returns

RetiredCopy