Scripting API

Scripting API

AddOnList

Class in Abyss.Core, from Abyss.Core.

The add-ons a game's build made: catalog.json, or catalog_1.23.1.json, in the folder the build writes them into, uploaded with them, and the same list in the game's main pack, which a game reads as it starts.

public sealed class AddOnList

Constructors

AddOnList

public AddOnList(AssetGuid game, IReadOnlyList<AddOn> addOns)

The add-ons of a game, in the order its groups are listed.

Parameters

  • game: The game's identity; none for a game that has none.
  • addOns: Its add-ons, each by its own name.

Properties

Empty

public static AddOnList Empty { get; }

A game with no add-ons.

Game

public AssetGuid Game { get; }

The game's identity, as every pack of its builds is stamped.

Built

public DateTimeOffset Built { get; init; }

When the build that made it ran: of two lists, the newer is the one a game goes by.

AddOns

public IReadOnlyList<AddOn> AddOns { get; }

Its add-ons, in the order its groups are listed.

Methods

FileFor

public static string FileFor(string version)

What the list a version of the game reads is called, catalog_1.23.1.json, sorted beside AddOnList.FileName and every other version's.

Parameters

  • version

Read

public static AddOnList Read(Pack pack)

The list a pack holds: a game's main pack's; AddOnList.Empty for one that holds none.

Parameters

  • pack

Exceptions

  • FormatException: It holds one this build does not read.

Parse

public static AddOnList Parse(string json)

A list from its words.

Parameters

  • json

Exceptions

  • FormatException: The words are not a list this build reads, saying why.

ToJson

public string ToJson()

The list as the words its file and the main pack hold.

Matches

public static bool Matches(AddOn addOn, string file)

Whether a file is the add-on the list names: as long as it says, and of the SHA-256 it says, read whole to say it.

Parameters

  • addOn
  • file

Exceptions

  • IOException: The file cannot be read.

Constants

FileName

public const string FileName = "catalog.json"

What it is called beside the add-ons, read by every version of the game; and in the player's folder, where the game keeps the one it read.

PackedName

public const string PackedName = "#addons"

What it is called in the main pack.

FolderName

public const string FolderName = "addons"

The folder a game looks for add-ons in as it starts: addons beside its main pack, where a store installs what the player has, and in the player's own folder, where what it downloads goes.

CurrentVersion

public const int CurrentVersion = 1

The version this build writes, and the newest it reads.