Documentation
¶
Overview ¶
Package check decides whether a built mod may run, without a game. It is the check a publishing service runs before it offers a release to players: a WebAssembly mod must keep to the host's imports and start in the host's sandbox limits, an interpreted mod must name a runtime Modlock ships, the settings and metrics a mod declares must be well formed, and its client content must stay in its own addon.
Index ¶
- Constants
- Variables
- func Addon(manifest *manifestpb.Manifest) string
- func AddonDirs() []string
- func AddonName(slug string, digest []byte) string
- func Content(dist fs.FS, addon string) error
- func ContentAddon(manifest *manifestpb.Manifest) error
- func Mod(ctx context.Context, dist fs.FS) (*manifest.Manifest, error)
- func Module(ctx context.Context, module []byte) error
- func Scripted(dist fs.FS) (string, error)
- func Slug(slug string) error
- func Version(version string) error
Constants ¶
const ContentDir = "panorama"
ContentDir is the built mod's directory of client content: the panorama directory of the mod's content addon, which a player's game mounts while it plays the mod.
const DataDir = sandbox.DataDir
DataDir is the built mod's directory of the files the mod reads.
const ManifestFile = sandbox.ManifestFile
ManifestFile is the manifest's file name in a built mod.
const MapsDir = "maps"
MapsDir is the directory of a project, and of its built mod, that holds the map the mod plays on when the mod ships its own: maps/<map>.vpk, which the session mounts beside the content addon, and maps/<map>.bsp for the Quake collision its movement model walks on.
Variables ¶
var AssetDirs = []string{"models", "materials", "particles"}
AssetDirs are the built mod's directories of compiled game resources that its content addon carries beside the Panorama content, each under the addon's name, as models/<addon>/pawn.vmdl_c. A mod names them with {addon} in the path, such as models/{addon}/pawn.vmdl.
Functions ¶
func Addon ¶ added in v0.1.8
func Addon(manifest *manifestpb.Manifest) string
Addon returns the name of the content addon a release of the mod ships: the manifest's content_addon, which names the slug and a digest of the content, or the slug and version for a mod built without it. Panorama keeps each layout it loads for the life of the game, so changed content gets a new name, while a release that changes only code keeps the addon the game already loaded. A slug belongs to one mod.
func AddonDirs ¶ added in v0.1.15
func AddonDirs() []string
AddonDirs returns every directory of a built mod that goes into its content addon: the Panorama content and the asset directories.
func AddonName ¶ added in v0.1.56
AddonName returns the content addon name of the mod slug whose content sources have digest, the SHA-256 the build takes of them.
func Content ¶ added in v0.1.8
Content checks that every file in dist's addon directories lies under the addon's name, panorama/<kind>/<addon>/ or <asset dir>/<addon>/, so one mod's content never replaces another's or the game's.
func ContentAddon ¶ added in v0.1.56
func ContentAddon(manifest *manifestpb.Manifest) error
ContentAddon reports whether manifest's content_addon is empty or names an addon of its own mod: its slug and an eight digit digest.
func Module ¶
Module checks that module keeps to the host's boundary and starts within the host's memory and time limits with every host request answered empty. It interprets the module, since compiling a large one takes far longer than the few calls the check runs.
func Scripted ¶ added in v0.1.8
Scripted returns the first file of dist's client content that runs code in a player's game, or "" when none does. A script runs code, and so does a layout that loads a script, holds one inline or handles an event. A layout this package cannot read counts as running code, so a publishing service can hold scripted content for creators it trusts.
Types ¶
This section is empty.