Class StandingPins
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
-
objectStandingPins
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
pinsIEnumerable<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
linesIEnumerable<string>sourcestring
Returns
- IReadOnlyList<KeyValuePair<string, string>>
Read(string)
Parse(IEnumerable<string>, string) of the file at path.
public static IReadOnlyList<KeyValuePair<string, string>> Read(string path)
Parameters
pathstring
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
pathstringpinsIEnumerable<KeyValuePair<string, string>>