Skip to main content

Module session

Module session 

Source
Expand description

A game running headless, for the operations that play it (run, scene) and the MCP server’s session (crate::mcp): Session, which any game gives as a Headless over its Harness.

The engine drives the session and reads it; the game says only how its Harness starts and, if it has them, what its scene is (Headless::with_scene), what happened in its rules (Headless::with_events) and how its frame looks (Headless::with_picture). The modules its game installed are read from the game itself.

With perf on (Session::set_perf), a Headless measures each frame with this machine’s clock and keeps its record, read with Session::perf (ADR-0046). In a debug build of the tool program each record has the heap’s counts too, from the program’s own heap counter (shuyi_alloc_count::global), which counts the whole program, and the game’s frames, spans and asset decodes are tagged in it (shuyi_alloc_count::tags): Session::heap_snapshot takes what holds the heap by tag. Start a session with measured_start to tag its start, the game’s load, load.

Structs§

AddedSound
A sound the game made at run time (AudioQueue::add_sound) and hasn’t removed: its cue and the shape of its samples, never the samples.
Headless
A Session over a game’s Harness.
LogEntry
A line of the game’s log.
ModuleEntry
A module installed in the game, with what it declared (ADR-0040).
Scene
The scene a stage shows, as text and as data.
SessionDifference
The first frame of a session record that played differently.
SessionInput
A session record to play, in place of a game’s start options.
SessionPlayed
How far a session record played.
Sound
A sound cue asked to play.

Enums§

Event
Something that happened while a session ran, with its frame (frames count from 1).

Traits§

Session
A game running headless.

Functions§

at_pointer
The value at JSON Pointer pointer (RFC 6901) in data; or, if it names nothing, why: the pointer, and the keys of the deepest object it reached.
measured_start
A session started by start with perf on: in a build that counts the heap, what the start allocates (the game’s load) counts under the load phase, and each asset decode under its kind, as in a game’s window. Use it where a session will be measured, so its snapshots say what the load holds.