Table of Contents

Class WorldIdentity

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

The identity a world fixture's own metadata file states: its name, seed and UID, as the game reads them when it loads the world and as cli_world and the session state report the UID (m_uid). Reading it before a run tells a wrong fixture (a reused world name holding another snapshot) from a world that fails to load, without starting the game.

public sealed record WorldIdentity
Inheritance
object
WorldIdentity

Constructors

WorldIdentity(string, string, int, long, int, string)

The identity a world fixture's own metadata file states: its name, seed and UID, as the game reads them when it loads the world and as cli_world and the session state report the UID (m_uid). Reading it before a run tells a wrong fixture (a reused world name holding another snapshot) from a world that fails to load, without starting the game.

public WorldIdentity(string Name, string SeedName, int Seed, long Uid, int WorldVersion, string File)

Parameters

Name string
SeedName string
Seed int
Uid long
WorldVersion int
File string

The metadata file read, relative to the fixture directory.

Properties

File

The metadata file read, relative to the fixture directory.

public string File { get; init; }

Property Value

string

Name

public string Name { get; init; }

Property Value

string

Seed

public int Seed { get; init; }

Property Value

int

SeedName

public string SeedName { get; init; }

Property Value

string

Uid

public long Uid { get; init; }

Property Value

long

UidText

The UID as a plan pins it (worlduid, WorldUid).

public string UidText { get; }

Property Value

string

WorldVersion

public int WorldVersion { get; init; }

Property Value

int

Methods

Parse(byte[], string)

The identity in one metadata file's bytes; file names it in messages and the result.

public static WorldIdentity Parse(byte[] bytes, string file)

Parameters

bytes byte[]
file string

Returns

WorldIdentity

Read(string)

The identity of the one world in fixture, in either layout NameOf(IEnumerable<string>) accepts: a chunked save's <name>/_main.<n>.fwl2 (every such file must state the same world; the highest n is reported) or the older <name>.fwl. Both hold a length-prefixed package that starts with the world version, the name, the seed name, the seed and the UID (Valheim 1.0.16 writes version 41; 37 was read the same way). Refuses a file it cannot read as that, rather than guess.

public static WorldIdentity Read(string fixture)

Parameters

fixture string

Returns

WorldIdentity