Skip to main content

ModArtifact

A class in TavernLib, TavernLib.Backend.Mods.

One build of a mod from its manifest: which targets it's for, where to download it and how it's packaged.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private JObject _rawThe artifact's original JSON object, kept so a record can write it back.
private static readonly string[] KeyOrderKey order of an artifact in the compiled manifest, which a record keeps.
private static readonly string[] LibraryKeyOrderKey order of a library dependency entry in a record.

Properties​

MemberWhat it is
string DownloadUrl { get; private set; }Where to download the build.
List<LibraryDependency> LibraryDependencies { get; private set; }Libraries the build needs in UserLibs.
string Package { get; private set; }dll or zip, or something this build of TavernLib doesn't know.
string Sha256 { get; private set; }The download's expected SHA-256, lower-case hex.
List<string> Targets { get; private set; }The targets the build is for, such as server or client_windows.
bool Usable { get; }True for the dll and zip packages.

Methods​

MemberWhat it is
bool Builds(string target)True when the build is usable and lists that target.
static ModArtifact FromJson(JToken token, string idForMsg)Parses one artifact. Throws ModManagerException when targets, download_url, sha256 or the libraries are missing or malformed.
string InstallName(string modId)The file name a dll build is saved as: the URL's file name if it ends in .dll, otherwise <modId>.dll.
2 private and internal methods
MemberWhat it is
private static JObject Reordered(JObject source, string[] order)Copies a JSON object with the listed keys first, in that order, then any other keys.
internal JObject ToRecordJson()Internal: the artifact's original JSON with keys in the manifest's order, for writing into a mod record.

Used in​

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