Table of Contents

Class CustomDataReading

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

The local player's custom data and profile, read through ValheimCLI's valheim.observe/custom-data. Character is the profile's name, ProfileFile its file name without .fch and FileSource where the game saves it (Local or Cloud). Data is the reading as returned.

public sealed record CustomDataReading
Inheritance
object
CustomDataReading

Constructors

CustomDataReading(string, string, string, string, IReadOnlyDictionary<string, string>, JsonElement)

The local player's custom data and profile, read through ValheimCLI's valheim.observe/custom-data. Character is the profile's name, ProfileFile its file name without .fch and FileSource where the game saves it (Local or Cloud). Data is the reading as returned.

public CustomDataReading(string Character, string ProfileFile, string FileSource, string ProfilePath, IReadOnlyDictionary<string, string> Values, JsonElement Data)

Parameters

Character string
ProfileFile string
FileSource string
ProfilePath string
Values IReadOnlyDictionary<string, string>
Data JsonElement

Fields

Source

public const string Source = "local-player-custom-data"

Field Value

string

Properties

Character

public string Character { get; init; }

Property Value

string

Data

public JsonElement Data { get; init; }

Property Value

JsonElement

FileSource

public string FileSource { get; init; }

Property Value

string

ProfileFile

public string ProfileFile { get; init; }

Property Value

string

ProfilePath

public string ProfilePath { get; init; }

Property Value

string

Values

public IReadOnlyDictionary<string, string> Values { get; init; }

Property Value

IReadOnlyDictionary<string, string>

Methods

Parse(JsonElement)

Parses a reading; an incomplete one, or one listing a key twice, throws rather than reading as "no data".

public static CustomDataReading Parse(JsonElement data)

Parameters

data JsonElement

Returns

CustomDataReading

Read(GameActor, string, string?)

Reads the custom data through capabilityPath, only the keys starting with keyPrefix if given.

public static CustomDataReading Read(GameActor client, string capabilityPath, string? keyPrefix = null)

Parameters

client GameActor
capabilityPath string
keyPrefix string

Returns

CustomDataReading