Skip to main content

ModManifest

A class in TavernLib, TavernLib.Backend.Mods.

One version of one mod, from a source's manifests folder (schema version 2 only).

Constructors​

MemberWhat it is
ModManifest()Created by TavernLib; mods don't make one.

Fields​

1 private and internal field
MemberWhat it is
internal const int SupportedMajorInternal: 2, the only manifest schema version this build reads.

Properties​

MemberWhat it is
List<ModArtifact> Artifacts { get; private set; }Every build, including ones with targets or packages this build doesn't know.
string Author { get; private set; }The author. Defaults to the part of the id before the first dot.
Dictionary<string, string> Dependencies { get; private set; }Mod id to minimum version.
string Description { get; private set; }The description. Empty if left out.
string Id { get; private set; }The mod id, Author.Repo.
string Name { get; private set; }The display name. Defaults to the id.
bool ParityRequired { get; private set; }True if players joining a server with this mod must have the same version. Required in the manifest.
List<string> Scenes { get; private set; }Scenes the mod works in (normal, quest, tutorial), or null for every scene.
string SourceRepo { get; private set; }The source the manifest was fetched from.
string Version { get; private set; }The version, MAJOR.MINOR.PATCH.

Methods​

MemberWhat it is
ModArtifact ArtifactFor(string target)The usable build for a target, or null.
static ModManifest FromJson(JObject d, string sourceRepo)Parses a manifest. null (with a warning) for an unsupported schema; throws ModManagerException for a broken one.
static bool RunsIn(List<string> scenes, string scene)True if the scene list is null, the scene is null, or the list has the scene.
4 private and internal methods
MemberWhat it is
private static bool ReadParity(JToken value, string idForMsg)Reads parity_required; throws if it isn't a boolean rather than guessing.
private static List<string> ReadScenes(JToken value, string idForMsg)Reads the scenes list; null means every scene, and an empty or non-string list throws.
internal static string Sha256Field(JObject d, string where)Internal: reads and checks a sha256 field: 64 hex characters, returned lower case.
internal static string Text(JObject d, string key, string fallback, string where)Internal: reads a string field, using the fallback when it's absent or null. Throws for any other type.

Used in​

Members of other types that take, return or hold a ModManifest: