The app asks the project's Gitea release list about five seconds after startup and every six hours. A stable release beats a newer prerelease, and a release is offered only when its tag is newer than the running build and it carries a .capsule asset for this target. A capsule is a ZIP with capsule.json and a payload. Every payload file carries its size and BLAKE3 digest in the manifest, and staging rejects absolute paths, parent segments, undeclared entries, digest mismatches, and versions that are not newer. The verified payload is stored under the app data directory, so a download survives a restart. The manifest and archive format live in crates/capsule-format, shared by the app's verifier and the release tool. Settings > Advanced shows the state, the notes, and the download and install buttons. The status bar shows an accent chip while an update is waiting. Install copies the app to a temp helper, asks the daemon to stop, and quits. The helper waits for the process, swaps the files with a rollback copy of each old file, removes stale files, and starts the new app. A failed swap puts the old files back and logs the reason. --check-updates runs the release check from a shell. The release tool in tools/capsule builds a capsule from the same files the installer puts down, using packager.toml, so a release does not need an installed copy. docs/updates.md covers the format and the release steps.
11 KiB
League Recorder (rune app)
The native front end for record-daemon. It talks to the daemon over its existing
named-pipe protocol and draws with rune.
Run it
cargo run
The binary is a windowed app on Windows (windows_subsystem = "windows" in main.rs), so
launching it from Explorer, the Run key or the login item never opens a console. The printing
modes still work from a shell: attach_console borrows the console of whatever started the app,
and nothing happens when nothing did.
The app starts the daemon if it isn't running, then reads its settings and status. cargo run -- --probe does the same without a window and prints the daemon's answers; cargo run -- --games
prints how many timelines load from disk.
Headless renders, for looking at a screen without a window:
cargo run -- --snap history.png --scene history
cargo run -- --snap settings.png --scene settings
cargo run -- --snap recording.png --scene recording # the settings tab
cargo run -- --snap recording-live.png --scene recording-live # a game being recorded
cargo run -- --snap recording-live-delete.png --scene recording-live-delete
cargo run -- --snap recording-idle.png --scene recording-idle
cargo run -- --snap audio.png --scene audio
cargo run -- --snap review.png --scene review
cargo run -- --snap review-full.png --scene review-full # the picture alone, at rest
cargo run -- --snap clips.png --scene clips
cargo run -- --snap clip.png --scene clip
cargo run -- --snap clips-many.png --scene clips-many --at 1 # 36 demo clips, to see the scrollbar
cargo run -- --snap many.png --scene many --at 1 # 60 sample games, to see the scrollbar
Pass --at 1 when the screenshot depends on a laid-out size (the scrollbar does): layout callbacks
run after the first frame.
--live renders without sample data: the app talks to the daemon and reads the real timelines
from disk. Loading them takes a few seconds with a large history, so give it time before --at.
cargo run -- --snap live.png --live --at 40
Without --live, a headless run never starts the daemon and reads no recording: App::new loads
the sample recordings from history::sample when it sees rune's tooling flags. Portraits still
come from the Data Dragon cache (or download into it) so the PNGs show real champion faces.
Test
cargo test
The tests pin the wire format the daemon parses (ipc::tests, settings::tests), timeline
reading (history::tests), highlight clipping (highlight::tests) and formatting.
Layout
| File | What it holds |
|---|---|
src/main.rs |
Entry point, single instance, notifications, app spec, --probe |
src/app.rs |
App state, poll (daemon answers, tray events, status), screen dispatch |
src/ipc.rs |
Protocol types and the named-pipe client, on a worker thread |
src/daemon.rs |
Finding, starting and logging the daemon |
src/settings.rs |
The daemon's settings model, field for field |
src/history.rs |
Timelines from disk and the values the cards show |
src/portraits.rs |
Champion portraits: the Data Dragon cache and its downloads |
src/highlight.rs |
Highlight clips from kill events |
src/export.rs |
ffmpeg clip export, the clips folder it fills and its miniatures |
src/os.rs |
Run key, toasts, tray icon and menu |
src/ui.rs |
Colours, cards, switches, sliders, buttons |
src/update.rs |
Release checks, the capsule format, staging, and the apply helper |
src/screens/ |
Settings, match history, clips, game review, the recording in progress |
Where this stands against TODO.txt
- Skeleton: done. Rune is pinned to
4ddf696b0f13ec618fdeb80b4c9ea1a6246547f1; the window opens and--snapwrites PNGs. - Pipe client: done and checked against the running daemon here:
--probeprints status, settings, encoders and audio devices, and parses the settings reply with the app's model. Requests are typed (Command), the worker thread keeps the UI off tokio, and the same types are tested against the daemon's serde names. - Settings: done. General, recording, audio and daemon tabs; device and encoder lists come from
getAudioDevicesandgetEncoders; changes go out throughupdateSettings, and each application volume slider sendsupdateAudioSourceas it moves. The recordings folder is shown, not typed, on the quick and recording tabs:Select folderasks the system for one, through thenative-file-dialogfeatureCargo.tomlturns on, and headless runs answer it from a script. Every path the settings show is cut in the middle against the row it sits in, so a narrow window elides and a wide one shows the whole thing. - Match history: done. Cards read
GameHistory.vue's fields (result, champion portrait, queue, KDA, CS/m, gold/m, LP change) from the raw API responses in each timeline, with the queue filters. Portraits come from Data Dragon and are cached on disk (src/portraits.rs). The list holds rows, not timelines:history::summariesparses each file, keeps aSummary, and drops the timeline with its events and raw responses, 20 rows at a time as the list scrolls. Opening a row reads that one timeline again, on a thread, and the review screen fills in when it arrives. Peak over 313 recordings: 165 MB, down from 2.1 GB. - Video: not libmpv. Rune ships a
Playerwith a native surface and frame seeking (Player::file,seek,duration), which removes the OpenGL and wgpu interop question the TODO opened. The review screen uses it. If clip-accurate seeking turns out to be worse than mpv's, the three options in TODO.txt still apply;Playeris confined toscreens/review.rs. - Game review: done. The clip fills the window at 16:9, with play/pause, +/-10 s, and a scrubber that marks every event; highlights (play, export) and the timeline sit in a side panel, one press away. ffmpeg exports each highlight. The Full screen button beside the volume, a double press on the picture, or F takes the whole display: the picture fills the screen and the controls fade in over its bottom while the pointer is on them, gone 400 ms after it leaves. Escape goes back.
- Audio channels: the recorder writes one audio stream per source, and the review screen opens
one player per stream (
export::extract_trackscopies each into the audio cache). Toggles under the transport mute a channel for listening, and clip and highlight exports mix only the channels left on. Recordings made before the split play as one mixed track. - OS integration: tray icon with open/hide/record/quit, launch at login through the Run key, single instance, and toasts on recording start and stop.
- Installer:
packager.tomltargets NSIS and copies the daemon, its OBS files and the VC++ runtime beside the exe.cargo install cargo-packager --locked && cargo packager --release. On the first run the app downloads ffmpeg (--fetch-ffmpegdoes it from a shell), so clip export is ready before the first clip. The installer has not been run on a clean VM yet. - Updates: the app checks Gitea releases, downloads a capsule, verifies it, and restarts into a helper that swaps the files. The apply path has been exercised on a scratch folder; it has not run against a capsule published on Gitea yet.
The recording screen
While the daemon records, the app opens on the game it is recording and can stop it. The
daemon's protocol answers about the daemon only — recording or not, and which game id — so the
screen reads the game where it is: /liveclientdata/allgamedata on https://127.0.0.1:2999,
the endpoint the daemon itself polls for its events, which needs no login. It is read once a
second on a thread of its own, together with the timeline the recorder opened for this game
(the champion, the queue and the summoner it fetched at the start) and the clip being written
in the recordings folder. Without the game's answer the screen still shows what it has, and
says it is waiting.
Stopping over the protocol is not the stop the recorder gives a game that ends by itself: the
recorder writes the video into a new timeline and leaves the open one behind, which would show
in Match history as a game that never happened, next to one with no champion. The app closes
the open timeline into the one holding the video (history::close_stopped), and "Stop and
delete" removes the clip and both.
Updates
The app checks the project's Gitea releases about five seconds after startup, then every six
hours. Settings > Advanced has the running version, the result, and the buttons that download a
release and restart to install it. A release carries a .capsule asset: a ZIP with
capsule.json at the root and every install file under payload/. The manifest names each
file with a size and BLAKE3 digest, and the app checks every one before it stages the update.
../tools/capsule builds a capsule from the release tree and packager.toml, without an
installed copy. --check-updates runs the same check from a shell. The restart starts a copy
of the app from the temp folder; that copy waits for the app and daemon to exit, replaces the
files, and starts the new app. A failed replace puts the old files back and writes
update.log under the app data directory. ../docs/updates.md has the format, the release
steps, and the limits.
The capsule is not signed. HTTPS and the per-file digests detect a broken or truncated download, not a server that serves a matching capsule.
Known gaps
- Item images are not drawn. Champion portraits download from Data Dragon on first sight and are cached under the user's cache directory; offline, a card falls back to initials on the champion's colour.
- The installer has not been run on a clean VM, and it is unsigned: SmartScreen will warn on
every download until it is signed. The VC++ runtime travels with it (
vendor/vcruntime), because Windows ships the UCRT but notVCRUNTIME140.dll,VCRUNTIME140_1.dllorMSVCP140.dll, and the app, the daemon and every OBS plugin import them.
The vendored crates
vendor/ also holds vcruntime/: the three redistributable DLLs the installer puts beside
the exes, copied from a machine with Visual Studio's runtime installed.
vendor/ holds three crates copied from rune's own vendor/: wgpu-hal, winit and
parley_engine. Rune builds against patched copies of these, and a dependency's
[patch.crates-io] does not apply to the app that depends on it, so Cargo.toml repeats the
patches here. They match the rune rev above; when the rev moves, refresh them from that checkout:
cp -r ../rune/vendor/{wgpu-hal,winit,parley_engine} vendor/