Table of Contents

Class StandingPins

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

ValheimCLI's standing expectations file (its [Expectations] File setting): one key=value pin per line, which the game checks before every command but its diagnostics. Format(IEnumerable<KeyValuePair<string, string>>) writes one, Parse(IEnumerable<string>, string) and Read(string) check one with ValheimCLI's own parser before a launch, so a malformed line fails here rather than as a refusal of every command in the game. Written by a script, eight pins once ended up on one space-separated line (a PowerShell array expanded into a string); that line is named as such.

public static class StandingPins
Inheritance
object
StandingPins

Methods

Format(IEnumerable<KeyValuePair<string, string>>)

The file's text: each pin on its own line, in the order given, ending with a newline. Every pin must parse as ValheimCLI parses a file line (a plugin GUID, name or file name with an MD5, any or absent; world, seed, worlduid or worldfiles), and each key appears once.

public static string Format(IEnumerable<KeyValuePair<string, string>> pins)

Parameters

pins IEnumerable<KeyValuePair<string, string>>

Returns

string

Parse(IEnumerable<string>, string)

The pins in a file's lines, as ValheimCLI reads them (blank lines and # comments skipped). Refuses the whole file, naming every bad line from source, when a line is not one key=value, a value does not fit its key, a key repeats, or it holds no pin: ValheimCLI refuses every command while any of these holds.

public static IReadOnlyList<KeyValuePair<string, string>> Parse(IEnumerable<string> lines, string source)

Parameters

lines IEnumerable<string>
source string

Returns

IReadOnlyList<KeyValuePair<string, string>>

Read(string)

public static IReadOnlyList<KeyValuePair<string, string>> Read(string path)

Parameters

path string

Returns

IReadOnlyList<KeyValuePair<string, string>>

Write(string, IEnumerable<KeyValuePair<string, string>>)

Writes Format(IEnumerable<KeyValuePair<string, string>>)'s text to path (UTF-8 without a byte order mark).

public static void Write(string path, IEnumerable<KeyValuePair<string, string>> pins)

Parameters

path string
pins IEnumerable<KeyValuePair<string, string>>