Table of Contents

Class TerrainSiteSnapshot

Namespace
Valheim.Testing.Game
Assembly
Valheim.Testing.Game.dll

Captures the loaded client ground, terrain collider and paint. A dedicated server can also be supplied to verify the same world, but only a client with a local player can report site-area readiness. Every command and its exact reply is retained so a test report can be audited without trusting only the parsed values. A snapshot is the probes' readings without expectations.

public sealed record TerrainSiteSnapshot : IEvidence
Inheritance
object
TerrainSiteSnapshot
Implements

Constructors

TerrainSiteSnapshot(string, string, DateTimeOffset, DateTimeOffset, IReadOnlyList<TerrainSiteReading>, IReadOnlyList<ObservedCommand>)

Captures the loaded client ground, terrain collider and paint. A dedicated server can also be supplied to verify the same world, but only a client with a local player can report site-area readiness. Every command and its exact reply is retained so a test report can be audited without trusting only the parsed values. A snapshot is the probes' readings without expectations.

public TerrainSiteSnapshot(string Site, string WorldUid, DateTimeOffset StartedUtc, DateTimeOffset FinishedUtc, IReadOnlyList<TerrainSiteReading> Readings, IReadOnlyList<ObservedCommand> Commands)

Parameters

Site string
WorldUid string
StartedUtc DateTimeOffset
FinishedUtc DateTimeOffset
Readings IReadOnlyList<TerrainSiteReading>
Commands IReadOnlyList<ObservedCommand>

Properties

Commands

public IReadOnlyList<ObservedCommand> Commands { get; init; }

Property Value

IReadOnlyList<ObservedCommand>

FinishedUtc

public DateTimeOffset FinishedUtc { get; init; }

Property Value

DateTimeOffset

Kind

Lower-case letters, digits and hyphens; it names the file.

public string Kind { get; }

Property Value

string

Readings

public IReadOnlyList<TerrainSiteReading> Readings { get; init; }

Property Value

IReadOnlyList<TerrainSiteReading>

Site

public string Site { get; init; }

Property Value

string

StartedUtc

public DateTimeOffset StartedUtc { get; init; }

Property Value

DateTimeOffset

WorldUid

public string WorldUid { get; init; }

Property Value

string

Methods

Capture(GameActor, string, string, IReadOnlyList<TerrainSitePoint>, TimeSpan, GameActor?, CancellationToken)

Wait for every point to be ready, then capture raw replies and parsed values. No game state is changed.

public static TerrainSiteSnapshot Capture(GameActor client, string site, string worldUid, IReadOnlyList<TerrainSitePoint> points, TimeSpan readinessTimeout, GameActor? server = null, CancellationToken cancellation = default)

Parameters

client GameActor
site string
worldUid string
points IReadOnlyList<TerrainSitePoint>
readinessTimeout TimeSpan
server GameActor
cancellation CancellationToken

Returns

TerrainSiteSnapshot

Compare(TerrainSiteSnapshot, TerrainSiteSnapshot)

Compare the same site's readings across two captures, excluding timestamps and raw command text.

public static IReadOnlyList<TerrainSiteDelta> Compare(TerrainSiteSnapshot before, TerrainSiteSnapshot after)

Parameters

before TerrainSiteSnapshot
after TerrainSiteSnapshot

Returns

IReadOnlyList<TerrainSiteDelta>