Scripting API
Scripting API
PackageFiles
Class in Abyss.Core, from Abyss.Core.
A package's files, compared: what a game's copy of one has changed of its original.
public sealed class PackageFilesConstructors
PackageFiles
public PackageFiles(IReadOnlyDictionary<string, string> hashes)Its files' hashes, as given.
Parameters
hashes: Each file's path in the package, with forward slashes, and its SHA-256 in lowercase hexadecimal.
Properties
Hashes
public IReadOnlyDictionary<string, string> Hashes { get; }Each file's path in the package and its SHA-256, in order of their paths.
Methods
Against
public PackageChanges Against(PackageFiles now)What now has that these files, its original's, have not.
Parameters
now
ChangesOf
public static PackageChanges? ChangesOf(string folder)What the game's copy of a package in folder has changed of the original its PackageFiles.FileName keeps the hashes of; null where it keeps none — a package made here, never installed — so has no original to differ from.
Parameters
folder
A file is hashed again only where its length or the time it was written differs from when it was last hashed, so asking again of a package of thousands of files reads only those changed.
Now
public static PackageFiles Now(string folder)What the package in folder carries now, as PackageFiles.Of hashes it, a file hashed again only where its length or the time it was written has changed since it last was.
Parameters
folder
Forget
public static void Forget(string folder)Forgets the hash of every file under folder, which the engine has just written: a drive keeping the time a file was written to the second may keep two writes of one length at one time.
Parameters
folder
CarriedBy
public static IReadOnlyList<string> CarriedBy(string folder)Every file the package in folder carries, by its path in it, with forward slashes.
Parameters
folder
Of
public static PackageFiles Of(string folder)The hashes of every file the package in folder carries, as they are now.
Parameters
folder
HashOf
public static string HashOf(string file)The SHA-256 of a file's bytes, in lowercase hexadecimal.
Parameters
file
HashOf
public static string HashOf(Stream stream)The SHA-256 of what stream holds, in lowercase hexadecimal.
Parameters
stream
Read
public static PackageFiles? Read(string folder)The hashes a game's copy of a package keeps of its original; null where it keeps none, or none that can be read.
Parameters
folder
Parse
public static PackageFiles Parse(string json)The hashes json keeps.
Parameters
json
Exceptions
FormatException: It is not whatPackageFiles.ToJsonwrites.
ToJson
public string ToJson()The hashes as a package keeps them, a file a line.
Fields
Folders
public static readonly IReadOnlyList<string> FoldersThe folders of a package that it carries whole: its Rust a crate in PackageFiles.Rust, as source, its native libraries built for each platform in PackageFiles.Native, and its scripts for a web game's page in PackageFiles.Web.
Constants
FileName
public const string FileName = "package.files.json"What a package's hashes are kept as, beside its manifest.
Web
public const string Web = "web"The folder of a package's scripts for a web game's page, which its [JSImport] methods call: a web build puts them in packages/<id> beside the page, apart from the game's own.
Rust
public const string Rust = "rust"The folder of a package's Rust, a crate, which the game's build links into the game's library.
Native
public const string Native = "native"The folder of a package's native libraries, a folder each by the runtime they are built for — native/win-x64/box2d.dll, native/linux-x64/libbox2d.so — which the game's build puts beside the game for the machine's own, and its C# calls by name; with the licenses of what they are built from, anywhere in it, which a built game's notices carry.
