Table of Contents

Class CliCapabilityManifest

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

What one pinned ValheimCLI build provides, tied to its plugin's exact SHA256: ValheimCLI is one plugin (PluginFile, declaring PluginGuid), and the manifest records its SHA256 and the extension commands it registers, with their result schema versions. An owned client's CliManifest names one, and Preflight() then refuses, before the game starts, an install whose ValheimCLI plugin is not that build (missing, another build of it, a second copy, a renamed file declaring its GUID) or lacks a capability the run uses, naming the capability. A file name, plugin GUID or version never stands for a capability: only a DLL with the manifest's hash does. ValheimCLI ships this file with its build; Generate(string, IEnumerable<string>, string?) writes one from a known build by reading the DLL's metadata and IL, never loading it. Read(string) is the one place that refuses anything but a one-plugin build, so every command that reads a manifest refuses it with the same error. Require(GameActor, params string[]) after launch stays the authoritative check: this one only fails earlier.

public sealed class CliCapabilityManifest
Inheritance
object
CliCapabilityManifest

Fields

PluginFile

ValheimCLI's plugin file name.

public const string PluginFile = "valheimCLI.dll"

Field Value

string

PluginGuid

ValheimCLI's BepInEx plugin GUID: the one name of the core plugin (its pin key and config file name derive from it).

public const string PluginGuid = "valheimCLI.valheimCLI"

Field Value

string

Properties

Build

Where the build came from, for messages and evidence: a repository and commit, or a release.

public string Build { get; set; }

Property Value

string

Capabilities

Every capability (owner/command) of the plugin and its result schema version.

[JsonIgnore]
public IReadOnlyDictionary<string, int> Capabilities { get; }

Property Value

IReadOnlyDictionary<string, int>

Plugin

The build's one plugin: its file name, SHA256, plugin GUID and the extensions it registers.

[JsonIgnore]
public CliManifestFile Plugin { get; set; }

Property Value

CliManifestFile

Schema

The manifest format; 1 is the only one.

public int Schema { get; set; }

Property Value

int

Methods

Check(string, IEnumerable<string>)

The static capability check of the owned client install install. The manifest's plugin must be installed exactly once, by SHA256, in BepInEx/plugins or BepInEx/scripts (any subfolder); no other DLL there may have its file name or declare its plugin GUID (another build, stale or renamed); and it must provide each of capabilities (owner/command) with result version 1, as Require(GameActor, params string[]) requires live. Refuses with System.InvalidOperationException, naming every problem and each capability it costs; System.ArgumentException for a malformed capability name. DLLs that are not ValheimCLI (the mods) are not judged. Returns what was checked, for the report.

public CliManifestCheck Check(string install, IEnumerable<string> capabilities)

Parameters

install string
capabilities IEnumerable<string>

Returns

CliManifestCheck

Generate(string, IEnumerable<string>, string?)

Writes the manifest of a known build from its DLL (files, full paths: the one plugin): its SHA256, the GUIDs of its [BepInPlugin] attributes, and the extensions its IL registers through ValheimCLI's ExtensionRegistry.Register(id, version, apiVersion, new ExtensionCommand(name, ...), ...) with literal names, each command's result version being the constructor's last argument. Nothing is loaded or run. Console-module listings and registrations without literal names are not claimed. A file that declares no plugin, a registration whose shape this reader does not know, or anything but one plugin file (Read(string)'s rule) is refused rather than guessed. listing, when given, is a cli_extensions reply (with or without its EXTENSIONS prefix) from a client that loaded exactly this plugin: every owner it registers must be live there with exactly the same commands and versions, so the game confirms what the IL says.

public static CliCapabilityManifest Generate(string build, IEnumerable<string> files, string? listing = null)

Parameters

build string
files IEnumerable<string>
listing string

Returns

CliCapabilityManifest

Read(string)

Reads and checks a manifest. Refuses a missing file (System.IO.FileNotFoundException) and one that is not a well-formed schema-1 manifest of a one-plugin build (System.IO.InvalidDataException, naming the file and the problem).

public static CliCapabilityManifest Read(string path)

Parameters

path string

Returns

CliCapabilityManifest

Validate()

The format's rules, a one-plugin build among them; refuses with System.ArgumentException.

public void Validate()

Write(string)

Writes the manifest after the same checks Read(string) makes.

public void Write(string path)

Parameters

path string