Table of Contents

Class FakeClientDataDirectory

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

For no-game tests only: within this scope (the current async flow), a simulated game client keeps its data in Directory, so DefaultSaveDirectory(ClientPlatform) returns it on every platform. A hosted-world test can then place its fixture in a temporary folder while every rule about the client's data directory still runs, including the macOS rule that refuses any other SaveDirectory. A real macOS client always uses the signed-in user's own directory (Valheim 1.0.16 ignores -savedir there); never use this scope in a run with a game. This scope is the only way to change the default: there is no environment variable, setter or plan field. Scopes nest: disposing one restores the one it was opened in. Dispose the innermost first; disposing an outer scope while an inner one is open throws and changes nothing, so a stale directory never stays in effect.

public sealed class FakeClientDataDirectory
Inheritance
object
FakeClientDataDirectory

Constructors

FakeClientDataDirectory(string)

public FakeClientDataDirectory(string directory)

Parameters

directory string

Properties

Directory

The simulated client's data directory, which holds its worlds_local.

public string Directory { get; }

Property Value

string

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()