Expand description
attach: a build that is already running, reached over the live link
(ADR-0047) instead of a game started headless. It needs no project:
the build is a debug build of a game with its backend’s link feature,
started with SHUYI_LINK=<port>, and its log’s line shuyi link: listening on <address>, token <token> gives the address and the token.
It connects, says hello, plays the steps as a player’s input (keys,
controller buttons, an action by name, waits counted in the build’s
own frames: shuyi_platform::script’s steps, run’s), lets frames
more frames pass, then reads the build’s
status, its frame as text, its log from log_since, and, if asked,
the window’s picture, written to a file. It changes nothing else in
the build. The wire’s types are shuyi_platform::link’s, the build’s
own.
With perf_since it reads the frames’ records too, summed up as run --perf sums them; with perf_follow it follows them instead, every
100 ms for follow_for seconds, writing each new record to a file as
a perf trace’s line as the build runs, so an agent reads the file as
it grows.
Structs§
- Attach
Follow - What
perf_followwrote. - Attach
Input - What
attachreaches and plays. - Attach
LogEntry - One line of the build’s log, with its number.
- Attach
Output - What
attachsaw. - Attach
Screenshot - The window’s picture, as written.
Constants§
- FOLLOW_
EVERY - How often
perf_followreads the build’s records. - FOLLOW_
FOR - How many seconds
perf_followfollows when not said. - MAX_
FOLLOW_ FOR - The most seconds
perf_followfollows.
Functions§
- attach
attach: reaches the buildinputnames, plays its steps and reads what it shows; the picture is written fromcwd.- idle
framesframes with no input as waits the link plays as exactly that many: the whole seconds, then the frames left over (none for 0). A second’s 60 frames are exact in seconds, and so are fewer than 60.- parse_
args - Reads
attach’s arguments (not--json). - text
- What
attachsaw, for people. - usage
- The usage of
attach.