Class CustomDataReading
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
-
objectCustomDataReading
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
CharacterstringProfileFilestringFileSourcestringProfilePathstringValuesIReadOnlyDictionary<string, string>DataJsonElement
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
dataJsonElement
Returns
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
clientGameActorcapabilityPathstringkeyPrefixstring