Class PackageLoader¶
Namespace: Apogee.Scripting
Assembly: Apogee.Scripting.dll
Runs the packages of a
@<id>/…as arequirealias for each package, so that a mod can use a dependency's modules;- confinement: a mod may
requirefiles of its own package and of the packages it depends on (andres://), nothing else; - the
fslibrary with the same rules: a mod readsres://, its own package, its dependencies', anduser://moddata/<id>/, and writes onlyuser://moddata/<id>/; - modules that run as the owner of the package they are in, whoever required them.
A script that fails stops its package (the error is logged and in the result), and what depends on it is not run; it never stops the game. Content the package brought stays loaded.
public sealed class PackageLoader
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
PackageLoader(VirtualFileSystem, PackageSet, PackageLoaderOptions?)¶
public PackageLoader(VirtualFileSystem files, PackageSet packages, PackageLoaderOptions? options = null)
Parameters¶
files VirtualFileSystem
packages PackageSet
options PackageLoaderOptions?
Methods¶
CanAccessFile(ScriptOwner, string, bool)¶
Gives
public bool CanAccessFile(ScriptOwner owner, string path, bool write)
Parameters¶
owner ScriptOwner
path string
write bool
Returns¶
CanLoadModule(ScriptOwner, string)¶
Gives
public bool CanLoadModule(ScriptOwner requester, string path)
Parameters¶
requester ScriptOwner
path string
Returns¶
Load(LuauVm)¶
Makes the owners, aliases and roots, and runs every package's scripts in vm, which was made with this loader's hooks.
public IReadOnlyList<PackageRunResult> Load(LuauVm vm)
Parameters¶
vm LuauVm
Returns¶
IReadOnlyList<PackageRunResult>
OwnerOfModule(string)¶
Gives
public ScriptOwner? OwnerOfModule(string path)
Parameters¶
path string