Table of Contents

Class InstallPins

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

What a game install or server runtime holds that ValheimCLI cannot report in game, pinned on disk before launch. Each value is a full SHA256; Of(string) computes them.

  • Game: the game's own code, every assembly_*.dll in the Managed folder that holds assembly_valheim.dll (<executable>_Data/Managed, in a macOS bundle Valheim.app/Contents/Resources/Data/Managed): assembly_valheim, assembly_utils, assembly_guiutils, assembly_postprocessing and the rest. A game update or another branch (default_old, default_pre1_0) that changes any of them changes this pin; one that changes only assets or Unity's own assemblies does not.
  • Loader: BepInEx's loader as one set (Valheim.Testing.Game.InstallPins.IsLoaderFile(string, System.StringComparison)): the Windows Doorstop proxy winhttp.dll and its doorstop_config.ini, a root libdoorstop.dylib, doorstop_libs and BepInEx/core. Another BepInEx, BepInExPack or Doorstop build changes it, and so does a proxy a mod manager replaced beside the pack's configuration. Loader is the same value for a reviewed loader package, so a plan, a package and every check of an install share one loader identity. BepInEx/config/BepInEx.cfg is configuration, not loader: BepInEx rewrites it when it binds its settings.
  • Patchers: the contents of BepInEx/patchers, which rewrite game assemblies before any plugin loads: a clean runtime has none, so a patcher a removed mod left behind changes this pin, and a refusal names the folder's entries.

Each value is the SHA256 of a listing: one line per file, <sha256> <relative path>\n with / separators, ordered by path (ordinal), as sha256sum prints it; Loader's paths are relative to the install's root, the others' to their folder. Finder's .DS_Store and AppleDouble ._* files are left out. An empty or absent folder hashes the empty listing.

public sealed class InstallPins
Inheritance
object
InstallPins

Fields

CoreDirectory

public static readonly string CoreDirectory

Field Value

string

GameAssemblies

The game's own assemblies in its Managed folder, which Game covers.

public const string GameAssemblies = "assembly_*.dll"

Field Value

string

GameAssemblyName

public const string GameAssemblyName = "assembly_valheim.dll"

Field Value

string

Properties

Game

public string Game { get; set; }

Property Value

string

Loader

public string Loader { get; set; }

Property Value

string

Patchers

public string Patchers { get; set; }

Property Value

string

Methods

Check(string, string)

Refuses the install at root unless its game assembly, loader and patchers are these pins, naming each that differs with the value found. kind names the install ("runtime", "client install"). Returns what it found.

public InstallPins Check(string root, string kind)

Parameters

root string
kind string

Returns

InstallPins

DirectoryHash(string)

The SHA256 of a folder's listing (Valheim.Testing.Game.FileHash.Listing(string, System.Collections.Generic.IEnumerable<string>)); an empty or absent folder hashes the empty listing, and a link in it is refused, as a host's listing refuses it.

public static string DirectoryHash(string directory)

Parameters

directory string

Returns

string

GameAssembly(string)

The game's code assembly under root: _Data/Managed/assembly_valheim.dll, in a macOS bundle .app/Contents/Resources/Data/Managed/assembly_valheim.dll, or in the macOS dedicated server valheim_server/Data/Managed/assembly_valheim.dll. None or more than one is refused.

public static string GameAssembly(string root)

Parameters

root string

Returns

string

GameHash(string)

The Game value: the listing hash of every GameAssemblies file directly in the Managed folder that holds GameAssembly(string).

public static string GameHash(string root)

Parameters

root string

Returns

string

LoaderHash(string)

The Loader value of the install at root: the listing hash of its loader files, relative to the root.

public static string LoaderHash(string root)

Parameters

root string

Returns

string

Of(string)

The pins of the install at root: its game assemblies, loader and patchers, as found.

public static InstallPins Of(string root)

Parameters

root string

Returns

InstallPins

Plugins(string, IReadOnlyDictionary<string, string>)

Plugin pins derived from the staged files instead of typed by hand (a plan's pins, not part of an InstallPins object): each value of files is a path relative to install (BepInEx/plugins/Jotunn.dll) and becomes that file's MD5, the value cli_manifest and cli_expect compare (Md5(string)), or is absent and stays so. Refuses a path that is not a file there, naming the DLLs its folder holds, so a mistyped candidate name fails before anything launches rather than as a pin the game cannot meet.

public static Dictionary<string, string> Plugins(string install, IReadOnlyDictionary<string, string> files)

Parameters

install string
files IReadOnlyDictionary<string, string>

Returns

Dictionary<string, string>

Record(IDictionary<string, string>, string)

The values as report provenance, under prefix (for example runtime: runtimeGameSha256).

public void Record(IDictionary<string, string> provenance, string prefix)

Parameters

provenance IDictionary<string, string>
prefix string

Validate(string)

Every value is a full SHA256. what names the install in the message ("runtime", "client install").

public void Validate(string what)

Parameters

what string