Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7b612ffd6
|
||
|
|
3f798ad364 | ||
|
|
38fdb6bd32 | ||
|
|
6ed7851d90 | ||
|
|
dadcacf1a0 | ||
|
|
1d0e8407bd | ||
|
|
a48e99b6c1 | ||
|
|
b42d94bf1d | ||
|
|
15b4c6b0ec | ||
|
|
2c967b3d63 | ||
|
|
1722a4ef56 | ||
|
|
b18d7dc80e |
No files matched your search
@@ -116,6 +116,22 @@ jobs:
|
||||
"dry_run=$($dry.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
|
||||
Write-Host "$(if ($dry) { 'DRY RUN of' } else { 'releasing' }) $full (pre-release: $pre)"
|
||||
|
||||
# The Overlay's build id is `git describe --dirty` at CMake's configure
|
||||
# (src/native/FrameLedger.Shm/CMakeLists.txt), and the next step edits tracked
|
||||
# files: every release until beta.18 shipped "<tag>-dirty". So the id is read
|
||||
# here, from the clean checkout, and handed to CMake through the environment;
|
||||
# buildid-check reads it back out of the published binaries.
|
||||
- name: Build id (the clean checkout)
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$id = "$(git describe --always --dirty --abbrev=12)".Trim()
|
||||
if ($LASTEXITCODE -ne 0 -or -not $id) { throw 'git describe failed' }
|
||||
if ($id.EndsWith('-dirty')) { throw "the checkout is dirty before the release has touched it: $id" }
|
||||
if ($id.Length -gt 31) { throw "build id '$id' is $($id.Length) characters; FlShmHandshake::buildId holds 31" }
|
||||
"FL_BUILD_ID=$id" >> $env:GITHUB_ENV
|
||||
Write-Host "FL_BUILD_ID = $id"
|
||||
|
||||
# 12_BUILD §Release-time token substitution: the effective date of a legal
|
||||
# document is the date it ships. The only placeholder that survives into the
|
||||
# repository, substituted here and nowhere else; the App embeds legal/*.md at
|
||||
@@ -200,6 +216,9 @@ jobs:
|
||||
# beta.14 (D50): the managed half too - the eight managed binaries, carrying the tag's full version.
|
||||
./tools/versioninfo-check.ps1 -BuildDir out/app -ManagedDir out/app -ExpectedProductVersion '${{ steps.version.outputs.version }}'
|
||||
if ($LASTEXITCODE -ne 0) { throw 'versioninfo-check over the published tree' }
|
||||
# beta.18: the native binaries carry the build id read from the clean checkout, exactly - never "<tag>-dirty".
|
||||
./tools/buildid-check.ps1 -BuildDir out/app -Expected $env:FL_BUILD_ID
|
||||
if ($LASTEXITCODE -ne 0) { throw 'buildid-check over the published tree' }
|
||||
$size = (Get-ChildItem out/app -Recurse -File | Measure-Object Length -Sum).Sum / 1MB
|
||||
Write-Host ("published tree: {0:N0} MB" -f $size)
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
# The GitHub Wiki is a copy of the repository's own pages (D53/D54, the owner, 2026-10-07): wiki/ (Home, the sidebar,
|
||||
# the developer pages) and guide/ (the user guide, which is the End-user part) with LIMITATIONS.md, assembled and checked
|
||||
# by tools/wiki-build.ps1 - the check build.ps1 runs as `wiki-check`. A page edited on the Wiki tab is overwritten here;
|
||||
# edit wiki/ or guide/ instead (docs/13_CI_CD.md §wiki.yml).
|
||||
#
|
||||
# Separate from release.yml on purpose. The release stays as it was and its dry run stays a pure rehearsal; a wiki that
|
||||
# fails to publish is a red run of its own, re-run on its own, never a red release. A step after `gh release create`
|
||||
# could never be re-run at all: the release would already exist.
|
||||
#
|
||||
# A release that release.yml creates with GITHUB_TOKEN fires no `release` event for other workflows. `workflow_run` does
|
||||
# fire - the Release run itself was started by the owner's tag push - and it runs THIS file as it is on main, so the job
|
||||
# checks out the commit the release was built from (head_sha) and links the repository's files at the tag (head_branch).
|
||||
|
||||
name: Wiki
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Release]
|
||||
types: [completed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: 'Branch, tag or commit to build the wiki from; repository files are linked at this ref'
|
||||
required: true
|
||||
default: main
|
||||
type: string
|
||||
publish:
|
||||
description: 'Publish to the Wiki tab (off: build, check and upload the pages only)'
|
||||
required: true
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
# The repository's default token is read-only; pushing to <repo>.wiki.git needs contents: write.
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: wiki
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
wiki:
|
||||
# A rehearsal of release.yml (workflow_dispatch) never publishes the wiki: only a run started by a pushed v* tag
|
||||
# that succeeded.
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'push' &&
|
||||
startsWith(github.event.workflow_run.head_branch, 'v'))
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
# Values reach the scripts through the environment only, never pasted into them.
|
||||
WIKI_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.event.workflow_run.head_branch }}
|
||||
WIKI_PUBLISH: ${{ github.event_name == 'workflow_run' || inputs.publish }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.event.workflow_run.head_sha }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and check the wiki
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
./tools/wiki-build.ps1 -Ref $env:WIKI_REF -Out out/wiki
|
||||
if ($LASTEXITCODE -ne 0) { throw 'wiki-build failed' }
|
||||
|
||||
- name: Upload the pages
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: wiki-${{ github.run_id }}
|
||||
path: out/wiki/**
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
- name: Publish to the Wiki tab
|
||||
if: env.WIKI_PUBLISH == 'true'
|
||||
shell: pwsh
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
gh auth setup-git
|
||||
if ($LASTEXITCODE -ne 0) { throw 'gh auth setup-git failed' }
|
||||
git clone --depth 1 "https://github.com/$env:GITHUB_REPOSITORY.wiki.git" wiki-repo
|
||||
if ($LASTEXITCODE -ne 0) { throw 'cloning the wiki failed - it must have one page created on github.com first' }
|
||||
Get-ChildItem wiki-repo -Force | Where-Object Name -ne '.git' | Remove-Item -Recurse -Force
|
||||
Copy-Item out/wiki/* wiki-repo -Recurse
|
||||
Set-Location wiki-repo
|
||||
git add -A
|
||||
git diff --cached --quiet
|
||||
if ($LASTEXITCODE -eq 0) { Write-Host "The wiki already shows $env:WIKI_REF; nothing to publish."; exit 0 }
|
||||
git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' commit -q -m "wiki: $env:WIKI_REF"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'commit failed' }
|
||||
# The wiki repository's branch is master (git ls-remote, 2026-10-07).
|
||||
git push origin HEAD:master
|
||||
if ($LASTEXITCODE -ne 0) { throw 'push failed' }
|
||||
Write-Host "Published the wiki at $env:WIKI_REF"
|
||||
+105
@@ -28,12 +28,117 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **The engine version of Unity, Godot and RPG Maker games**, as Unreal Engine's has been shown since beta.10 — on the game's
|
||||
page with what it was read from, and the maker on the library card too: *Unity 2022.3.39f1* (from the player library,
|
||||
else its data file; a game whose data file is encrypted reads without the release letter, *2019.4.40*), *Godot 4.4.1*
|
||||
(from its data pack), *RPG Maker MZ 1.10.0* and *MV 1.6.2* (from the core script), *RPG Maker VX Ace (RGSS 3.0.1)*
|
||||
(from the runtime library its `Game.ini` names — that number is the library's, not the editor's). A Unity version used
|
||||
to read as its library's build number (`2022.3.39.5118735`), and a Godot one was never found. Every game is read once
|
||||
more after the update (detection rules `2026.10.2`). RPG Maker 2000/2003 is not recognised (`docs/05_DETECTION.md`
|
||||
§Engine version — Unity, Godot, RPG Maker).
|
||||
- **The Privacy Policy (version 2.8)** names the files those versions are read from, and two that were already read and
|
||||
never named (Unity's player library and an RPG Maker game's title); it is shown once for you to accept.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Change executable… opens in the game's own folder** — the install folder a store made (`steamapps\common\<game>`
|
||||
and the like), or above an Unreal game's `Binaries\Win64`, else the folder the executable is in — instead of wherever
|
||||
the last file dialog was. For a game whose folder is gone it opens at the nearest folder still there
|
||||
(`docs/08_UI.md` §Games).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **An imported game is no longer one of its helpers, and an RPG Maker MV/MZ game behind a launcher is its runtime.**
|
||||
A Doll's Locket - Remake (itch) was added as `notification_helper.exe`, NW.js's notification helper, because the itch
|
||||
app's own record named only that file (it leaves out a launcher that asks for administrator and anything a folder
|
||||
deeper) and the import took it as the game. A helper named by the store is skipped now and the executable is guessed —
|
||||
the import list says so — and the guess takes the executable beside NW.js's `nw.dll` and `package.json`, the process
|
||||
that draws (`css\Game.exe` there; its launcher asks for administrator, so it is measured with *Run the agent as
|
||||
administrator* on). The import also no longer offers a store's game again when the library has it at another
|
||||
executable: an entry already there is re-pointed with *Change executable…* (`docs/05_DETECTION.md` §Library import).
|
||||
|
||||
## [0.1.0-beta.18] - 2026-10-07
|
||||
|
||||
**The eighteenth pre-release: every page readable in the dark theme, notices that say what happened in words, and a
|
||||
release whose build no longer calls itself dirty.** The same unsigned installer: verify its hash against
|
||||
`SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.17`:** Help ▸ Check for updates, then *Restart to update* with no game running. Nothing in
|
||||
the database changes and nothing is shown again for you to accept; sessions already stored keep their status.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Page titles and section headings read in the dark theme again.** Every page's title and its section headings — Dashboard,
|
||||
Recent sessions, Games, Compare, Settings and each of its groups, Logs — were drawn near-black on the dark window
|
||||
(owner's screenshots of beta.17; beta.16 had it too). A page is shown in WPF UI's navigation Frame, which passes no text
|
||||
colour into the page, and a text that sets none is black; a page open during a theme switch picked the right colour up,
|
||||
and the next one navigated to did not. Every page now sets the theme's text colour itself. `AccessibilityTests.EveryPageSetsItsOwnTextColour`
|
||||
and `PagesLoadTests.EveryTextIsReadableInBothThemes` (every surface hosted as the App hosts it, ≥ 3:1 in both themes)
|
||||
went red on the unfixed pages first; the theme-switch check now hosts pages in the Frame too, and its harness derives the
|
||||
accent for each theme as the App does (`docs/08_UI.md` §Contrast, `docs/16_WPFUI_SYNTAX.md` §Gotchas, `docs/14_TESTING.md`).
|
||||
- **Every notice says what happened in words.** With *Disable all hooking* on, a game's notice read "kill switch was
|
||||
detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)" — it reads "All hooking is switched
|
||||
off in Settings, so nothing was measured." now, and a game blocked before reads as that, not as a finding. A refusal no
|
||||
anti-cheat names read "… reason RefusedByGuard." and is said in the guard's words ("the game is 32-bit, and the hook
|
||||
runs in 64-bit games only"); the agent sends the guard's reason for every refusal (`docs/07_IPC.md`). A safety re-scan
|
||||
that could not look while the game ran read "Access is denied. was detected" and says the check could not be made. And
|
||||
*Measurement stopped* printed "The hook stopped (WriterSelfDisabled); the session continues without measuring." — it
|
||||
says why in a sentence, and no longer that the session went on: a stop ends it. `NoticesFromTheAgentTests` builds the
|
||||
agent's own events for every refusal and every stop and went red with each text above (`docs/08_UI.md` §Notifications policy).
|
||||
- **Disable all hooking says when it applies.** Turning it on said "The capture agent reads it at the next session start";
|
||||
a game being measured stops at its next safety scan, within 30 seconds, and the message says so.
|
||||
- **Turning hooking off with no agent says nothing changed** — Settings' *Turn off*, the game page's switch and a
|
||||
withdrawn exception said "Nothing was enabled.", the enabling path's words.
|
||||
- **A viewer over a copy leaves every agent setting alone.** The user-mode exception option, the three Recording numbers
|
||||
and the update channel stayed live in `--data-dir`, where no agent reads them (`ViewerModeTests`).
|
||||
- `docs/08_UI.md` listed a "PawnIO missing" banner that was never built; struck, with the banners that do exist.
|
||||
- **A release's overlay build no longer calls itself dirty.** The Dashboard read *Overlay build v0.1.0-beta.17-dirty* (and
|
||||
beta.16's, and every release's before): the release workflow writes the release date into the legal documents before
|
||||
the build, and the build id was read from the tree after that. It is read from the clean checkout first and handed to
|
||||
the build, and `tools/buildid-check.ps1` reads it back out of the published binaries (`docs/12_BUILD.md` §Release-time
|
||||
token substitution). Nothing changes for a game: both sides of the ring's handshake always carried the same id.
|
||||
- **Two end-to-end tests no longer fail CI by a race** (developers only). The Vulkan launch test asks the test harness
|
||||
whether this machine can present through Vulkan before it starts the capture host: on GitHub's runners the harness's
|
||||
own "skip" line never reached the host's output, and a scan of the exiting harness failed the test instead of skipping
|
||||
it. The target-exit test holds its harness 15 seconds instead of 6, the margin a slow runner's host needed
|
||||
(`docs/13_CI_CD.md`).
|
||||
|
||||
## [0.1.0-beta.17] - 2026-10-07
|
||||
|
||||
**The seventeenth pre-release: text that keeps up with a change of theme, scroll bars hidden everywhere when you ask, a
|
||||
user guide that answers more, and a wiki.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then
|
||||
*More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.16`:** Help ▸ Check for updates, then *Restart to update* with no game running. Nothing in
|
||||
the database changes and nothing is shown again for you to accept; sessions already stored keep their status.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Text keeps up with a change of theme.** After switching between Light and Dark, the descriptions and captions of the
|
||||
page in view — Settings above all, where the theme is chosen — kept the old theme's colour: light grey on white, or dark
|
||||
grey on dark. Every such text now follows the switch, on every page, window and dialog (`08_UI` §Contrast,
|
||||
`16_WPFUI_SYNTAX` §Gotchas).
|
||||
- **Hide scroll bars hides every scroll bar.** With Settings ▸ Window ▸ Hide scroll bars on, the Dashboard still drew its
|
||||
scroll bar — and so did the first run, About, the user guide and a game's wide sessions table; only screens with a
|
||||
switch or a tick box on them lost theirs. Every scroller follows the option now, and still scrolls with the wheel, the
|
||||
keyboard and touch (`08_UI` §Settings, `16_WPFUI_SYNTAX` §Gotchas).
|
||||
- **The first run names the right place to import your library.** Its last step said *File ▸ Import library… on the
|
||||
Games page*; File is the main window's menu, and the Games page has no such button. In Vietnamese it now names the menu
|
||||
as it is shown (*Tệp*).
|
||||
|
||||
### Added
|
||||
|
||||
- **The user guide looks things up too.** Four pages join it, in Help ▸ User guide: *The screens* (every page, menu,
|
||||
button and shortcut), *Every setting* (what each one does and its default), *When something goes wrong* (what you see,
|
||||
what it means, what to do) and *Words FrameLedger uses*. Tests now fail when a setting or a menu item is added without
|
||||
its line in the guide, or a link names a section that does not exist.
|
||||
- **A wiki.** The project's [wiki](https://github.com/poli0981/frameledger/wiki) has two halves: the user guide, the
|
||||
same pages the app shows, and short pages for developers — the architecture, the repository, building and testing,
|
||||
the rules every change keeps, capture, metrics, data, the app's UI and releasing — each linking to its full document.
|
||||
It is published from the repository whenever a release is made (`wiki.yml`), so it always matches the newest
|
||||
release, and `./build.ps1 check` fails on any link in it that leads nowhere (`13_CI_CD` §wiki.yml).
|
||||
|
||||
## [0.1.0-beta.16] - 2026-10-06
|
||||
|
||||
|
||||
@@ -138,7 +138,9 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
|
||||
# gen-ac-floor, hookinventory-check, license-check, license-gather
|
||||
# (+ license-overrides/), notice-check, package-closure-check,
|
||||
# release-notes, rules-validate, test-artifacts-check, vendor-exports,
|
||||
# versioninfo-check, vklayer-blastradius, fps-impact-runbook
|
||||
# versioninfo-check, vklayer-blastradius, fps-impact-runbook,
|
||||
# wiki-build (beta.17: builds and checks the wiki; the wiki-check gate),
|
||||
# buildid-check (beta.18: the release's build id in the shipped natives)
|
||||
# (six names added 2026-10-04)
|
||||
# (PowerShell). This line used to name three, one of which
|
||||
# — resx-audit — ~~does not exist~~ exists since 2026-09-13 with
|
||||
@@ -151,8 +153,13 @@ tools/ # accuracy-check, changelog-check, chokepoint-che
|
||||
# stats, signer, Vulkan layer; fl-baseline-probe;
|
||||
# vendor-stubs/ -> fixture DLLs with the vendors' export names
|
||||
rules/detection-rules.json # engine/platform/capability + anticheat blocklist
|
||||
guide/ # the user guide (beta.12, D44): eight short English pages for players, embedded in the
|
||||
guide/ # the user guide (beta.12, D44): ~~eight~~ short English pages for players, embedded in the
|
||||
# App (Help > User guide); README.md is its contents. docs/ is for developers.
|
||||
# (twelve since beta.17, D54: the screens, every setting, troubleshooting, a glossary;
|
||||
# and the guide is the wiki's End-user part)
|
||||
wiki/ # the wiki's own pages (beta.17, D53): Home, _Sidebar, the developer pages. wiki.yml
|
||||
# publishes them with guide/ and LIMITATIONS.md to the Wiki tab at a release;
|
||||
# tools/wiki-build.ps1 assembles and checks them (build.ps1 wiki-check)
|
||||
docs/ legal/ legal/licenses/
|
||||
```
|
||||
|
||||
|
||||
@@ -27,6 +27,11 @@ That is the whole quality gate, and continuous integration runs the identical sc
|
||||
checks (licences, the accuracy blocks, the licence headers, the changelog rules, …). `docs/12_BUILD.md` describes each
|
||||
step and the build profiles. Run it in your main checkout: a fresh `git worktree` cannot configure the native build.
|
||||
|
||||
Documentation lives in three places: `guide/` for players (shown in the app and on the wiki), `wiki/` for the wiki's own
|
||||
pages, and `docs/` for developers. A change a player would notice updates `guide/`; a change to how the code is put
|
||||
together updates `docs/` — and the `wiki/` page that summarises it, if that page now says something else.
|
||||
`./build.ps1 check` builds the wiki and fails on a link that leads nowhere.
|
||||
|
||||
Never point a build of your own at the data FrameLedger records into (`%LOCALAPPDATA%\FrameLedger`): a newer build
|
||||
migrates the database, and the released one cannot read it back. To look at real data, copy the folder and start
|
||||
`FrameLedger.exe --data-dir <copy>` — a viewer that starts no Agent and changes nothing on the PC (`docs/12_BUILD.md`
|
||||
|
||||
+8
-3
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.16.*
|
||||
*Beta software: this page describes version 0.1.0-beta.18.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -117,8 +117,13 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
|
||||
|
||||
- The exact version is read for **Unreal Engine 4 and 5** games, from the game's executable file on disk.
|
||||
A studio can remove or rename what it is read from; then the page says the version was not found.
|
||||
**Unreal Engine 3 and older are not recognised.** Other engines show a version only where their files
|
||||
state one. ([Detection](docs/05_DETECTION.md))
|
||||
**Unreal Engine 3 and older are not recognised.**
|
||||
- Since beta.19 also **Unity**, **Godot** and **RPG Maker** (MV, MZ, XP, VX, VX Ace): from the engine's own files —
|
||||
Unity's player library or data file, Godot's data pack, RPG Maker's core script or the runtime library its `Game.ini`
|
||||
names. A Unity game whose data file is encrypted shows the version without its release letter (`2019.4.40`, not
|
||||
`2019.4.40f1`); an XP, VX or VX Ace game shows its runtime library's number, which is not the editor's.
|
||||
**RPG Maker 2000 and 2003 are not recognised.** Other engines show a version only where their files state one.
|
||||
([Detection](docs/05_DETECTION.md))
|
||||
|
||||
## Sensors
|
||||
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
> No telemetry. No accounts. All data stays on your machine.
|
||||
|
||||
**New here? Start with the [user guide](guide/README.md)** — install, record a game, read your results, stay safe with
|
||||
anti-cheat, and look after your data, a page each. What FrameLedger cannot do is on one page:
|
||||
[Limitations](LIMITATIONS.md). Both are in the app too (Help ▸ User guide, Help ▸ Limitations).
|
||||
anti-cheat, and look after your data, a page each, then every screen, every setting and what to do when something goes
|
||||
wrong. What FrameLedger cannot do is on one page: [Limitations](LIMITATIONS.md). Both are in the app too (Help ▸ User
|
||||
guide, Help ▸ Limitations), and on the project's [wiki](https://github.com/poli0981/frameledger/wiki) with the developer
|
||||
pages.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.16`** (2026-10-06), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.18`** (2026-10-07), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -61,8 +63,11 @@ anti-cheat, and look after your data, a page each. What FrameLedger cannot do is
|
||||
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
|
||||
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
|
||||
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
|
||||
> files state.
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
|
||||
> player library or its data file — without the release letter where only the library's number is readable),
|
||||
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
|
||||
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
|
||||
> engines show what their own files state.
|
||||
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
|
||||
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
|
||||
> once a second from Windows' own counters, from outside the game, in every session: a game
|
||||
@@ -161,7 +166,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.16` (2026-10-06); before it `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest pre-release is `v0.1.0-beta.18` (2026-10-07); before it `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
@@ -191,6 +196,8 @@ FrameLedger is GPL-3.0-only free software, and you are welcome to build it, chan
|
||||
[`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md). Security reports: [`SECURITY.md`](SECURITY.md).
|
||||
- **Fork or redistribute:** [`FORKING.md`](FORKING.md) — what the GPL asks of anyone who distributes builds, and the names
|
||||
a fork must change so it does not share FrameLedger's update feed, install folder, data, pipe or Vulkan layer.
|
||||
- **Find your way around:** the [wiki](https://github.com/poli0981/frameledger/wiki)'s developer pages are short, and each
|
||||
links to the document it summarises ([`wiki/`](wiki/) is their source).
|
||||
- **Read the design:** the developer documentation is in [`docs/`](docs/). Start with [`CLAUDE.md`](CLAUDE.md), then
|
||||
[`docs/19_SAFETY_AND_ANTICHEAT.md`](docs/19_SAFETY_AND_ANTICHEAT.md) — which constrains everything else — then
|
||||
[`docs/01_ARCHITECTURE.md`](docs/01_ARCHITECTURE.md).
|
||||
@@ -208,4 +215,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
|
||||
|
||||
---
|
||||
|
||||
**Status:** pre-release (beta). Sixteen tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
**Status:** pre-release (beta). Eighteen tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
@@ -464,6 +464,15 @@ function Invoke-ProjectGates {
|
||||
Invoke-Checked 'notice-check (self-test)' { & $noticeTool -SelfTest }
|
||||
Invoke-Checked 'notice-check' { & $noticeTool -RepoRoot $repo }
|
||||
|
||||
# beta.17 (D53/D54): the GitHub Wiki is built from wiki/, guide/ and LIMITATIONS.md, and wiki.yml publishes it when a
|
||||
# release is made. A link or a section that leads nowhere, a page nothing leads to, a sidebar out of the guide's
|
||||
# order, a path that names nothing or a version written into a page is red here, not on the published wiki.
|
||||
# Self-test first (nine cases, both directions), then the live assembly into a temporary folder.
|
||||
Write-Step 'wiki-check'
|
||||
$wikiTool = Join-Path $repo 'tools/wiki-build.ps1'
|
||||
Invoke-Checked 'wiki-check (self-test)' { & $wikiTool -RepoRoot $repo -SelfTest }
|
||||
Invoke-Checked 'wiki-check' { & $wikiTool -RepoRoot $repo -Check }
|
||||
|
||||
Write-Step 'changelog-check'
|
||||
$changelogTool = Join-Path $repo 'tools/changelog-check.ps1'
|
||||
if (Test-Path $changelogTool) {
|
||||
@@ -479,6 +488,12 @@ function Invoke-ProjectGates {
|
||||
Write-Step 'release-notes'
|
||||
Invoke-Checked 'release-notes (self-test)' { & (Join-Path $repo 'tools/release-notes.ps1') -SelfTest }
|
||||
|
||||
# beta.18: the build id a release hands CMake (read from the clean checkout before the date substitution edits
|
||||
# legal/*.md) is read back out of the published native binaries by release.yml. Self-test only here — the live
|
||||
# pass needs that id, which only a release has (12_BUILD §Release-time token substitution).
|
||||
Write-Step 'buildid-check'
|
||||
Invoke-Checked 'buildid-check (self-test)' { & (Join-Path $repo 'tools/buildid-check.ps1') -SelfTest }
|
||||
|
||||
# 09_I18N's gate, built with the first .resx family (P3 PR-2, 2026-09-13): every key in en/vi/ja, ja
|
||||
# Safety_* marked for human review, the generated accessor current. Self-test first (at least four
|
||||
# cases must go red), then the live pass; a tree with no family is red, not skipped.
|
||||
|
||||
+68
-4
@@ -143,12 +143,12 @@ Recorded as a residual risk, not as a solved problem.
|
||||
|
||||
| Engine | Signals | Version |
|
||||
|---|---|---|
|
||||
| Unity | `UnityPlayer.dll` sibling **or** `<Exe>_Data/` dir | FileVersion of `UnityPlayer.dll` |
|
||||
| Unity | `UnityPlayer.dll` sibling **or** `<Exe>_Data/` dir | `unity_build` (since 2026-10-12, §Engine version — Unity, Godot, RPG Maker): the player library's ProductVersion, the data file's header, the library's numeric version. ~~FileVersion of `UnityPlayer.dll`~~ — the string as it is, `2022.3.39.5118735`, the build number where the release letter belongs |
|
||||
| Unreal 4/5 | exe matches `*-Win64-Shipping.exe` **or** `*/Content/Paks/*.pak` | `unreal_build` (since 2026-09-27, §Engine version): the shipping executable's numeric file version and the engine's branch name inside it. ~~ProductVersion regex `\+\+UE(4\|5)\+Release-(\d+\.\d+)`~~ — two capture groups, of which the evaluator returns the first, so every Unreal version it ever stored was a bare `4` or `5` |
|
||||
| Godot | `.pck` sibling **or** `strings_contains("Godot Engine v")` | strings regex `Godot Engine v(\d+\.\d+[\.\d]*)` |
|
||||
| Godot | `.pck` sibling **or** `strings_contains("Godot Engine v")` | `godot_build` (since 2026-10-12): a data pack's header, beside the executable or appended to it. ~~strings regex `Godot Engine v(\d+\.\d+[\.\d]*)`~~ — the string sits 57–78 MB into a real export, past the 8 MiB scan, so it never read one |
|
||||
| GameMaker | `data.win` | `N/A` |
|
||||
| RPG Maker MV/MZ | `nw.dll` **and** `package.json` siblings (since 2026-09-16) | `N/A` — the `.js` header needs a `from` that `strings_regex` lacks |
|
||||
| RPG Maker XP/VX/VX Ace | `RGSS1*`/`RGSS2*`/`RGSS3*.dll` sibling **or** a `*.rgssad`/`*.rgss2a`/`*.rgss3a` archive (since 2026-09-16) | `N/A` — one rule, the variant unnamed |
|
||||
| RPG Maker MV/MZ | `nw.dll` **and** `package.json` siblings (since 2026-09-16) | `rpgmaker_build` (since 2026-10-12): the core script's header, which also names the maker (MZ or MV). ~~`N/A` — the `.js` header needs a `from` that `strings_regex` lacks~~ |
|
||||
| RPG Maker XP/VX/VX Ace | `RGSS1*`/`RGSS2*`/`RGSS3*.dll` sibling **or** a `*.rgssad`/`*.rgss2a`/`*.rgss3a` archive (since 2026-09-16) | `rpgmaker_build` (since 2026-10-12): the RGSS library `Game.ini` names — its generation names the maker (XP, VX, VX Ace), its version is the library's. ~~`N/A` — one rule, the variant unnamed~~ |
|
||||
| RE Engine (Capcom) | `re_chunk_000.pak` sibling, the exact name (since 2026-09-23) | `N/A` |
|
||||
| FromSoftware | a `*.bhd` **and** a `*.bdt` sibling (since 2026-09-23) | `N/A` |
|
||||
| Ren'Py | `renpy/` dir **or** `*.rpa` | ~~`renpy/__init__` strings / `log.txt` first line~~ `N/A` *(corrected 2026-10-04: no extractor — `strings_regex` reads only the executable)* |
|
||||
@@ -246,6 +246,47 @@ numbered release lines to report. A version the user typed is never overwritten
|
||||
`2026.09.6` change the key, so every library entry is read again once; schema 0015 removes the bare `4`/`5` the old rule
|
||||
wrote, where detection wrote it.
|
||||
|
||||
### Engine version — Unity, Godot, RPG Maker (beta.19, 2026-10-12, rules 2026.10.2)
|
||||
|
||||
The owner asked for the version of RPG Maker, Unity and Godot games ("if possible"). What the rules gave: Unity's
|
||||
`pe_file_version` stored `UnityPlayer.dll`'s FileVersion string as it is (`2022.3.39.5118735`, the build number where the
|
||||
release letter belongs); Godot's `strings_regex` scanned the executable's first 8 MiB, and in both Godot exports on the
|
||||
owner's disk the `Godot Engine v…` string sits 57–78 MB in, so it never read one; both RPG Maker rules had `version: null`.
|
||||
**Measured before anything was written, read-only, on 23 installs** (`spike-notes` §17), and decided in code as Unreal's
|
||||
is — three extractor types that take no parameter (`unity_build`, `godot_build`, `rpgmaker_build`; the schema's enum),
|
||||
one second read by `StaticGameDetector` for the engine that matched, a decider in `Domain.Detection` and the witness in
|
||||
`games.engine_version_source`:
|
||||
|
||||
| Engine | Witness, strongest first | Source id | On the owner's disk |
|
||||
|---|---|---|---|
|
||||
| Unity | `UnityPlayer.dll`'s ProductVersion is an editor version (`2022.3.39f1 (4e1b…)` → `2022.3.39f1`) | `unity_player` | 13 of 15 |
|
||||
| | the header of `<Game>_Data\globalgamemanagers` (first 256 bytes) names one | `unity_data` | A Space for the Unbound, 2019.4.1f1 |
|
||||
| | the library's numeric file version, MAJOR.MINOR.PATCH and no release letter — Unity's own binary, so the engine's, only shorter | `unity_player_file` | GIRLS' FRONTLINE 2 (data file encrypted), 2019.4.40 |
|
||||
| Godot | the 20-byte header of the data pack beside the executable (`<exe>.pck`, else the only `.pck` there): `GDPC`, format, MAJOR, MINOR, PATCH | `godot_pck` | both: 4.2.2, 4.4.1 |
|
||||
| | the same header of a pack appended to the executable, found through its 12-byte trailer (size + `GDPC`) | `godot_pck_embedded` | none (synthetic files only) |
|
||||
| | the executable's ProductVersion while its ProductName is still `Godot Engine` (a project that set its own carries the game's: 衔蝶 `0.1.0.3`) | `godot_exe` | — |
|
||||
| RPG Maker MV/MZ | line 2 of the core script: `js/rmmz_core.js` → MZ, `www/js/rpg_core.js` or `js/rpg_core.js` → MV (first 4 KiB) | `rpgmaker_mz_core`, `rpgmaker_mv_core` | MZ 1.10.0; MV 1.6.2, 1.6.2, 1.6.1 |
|
||||
| RPG Maker XP/VX/VX Ace | the RGSS library `Game.ini`'s `Library=` names: RGSS1 → XP, RGSS2 → VX, RGSS3 → VX Ace; its numeric version when it is its generation's, else the one its name carries (`RGSS301` → 3.0.1) | `rgss1_library`, `rgss2_library`, `rgss3_library` | VX Ace 3.0.1, twice |
|
||||
|
||||
A Godot version leaves out a zero patch, as Godot names its releases (4.3, 4.2.2). The App names the maker from the
|
||||
witness — the two RPG Maker rules each cover several makers — and says that an RGSS number is the runtime library's, not
|
||||
the editor's: *RPG Maker MZ 1.10.0*, *RPG Maker VX Ace (RGSS 3.0.1)* (`Formats.Engine(id, source)`,
|
||||
`Formats.EngineWithVersion`); the game page's *Engine version* row says what each version was read from, and *Not found in
|
||||
the game's files* once the sweep has read a row of these engines and found none.
|
||||
|
||||
**Where it is read.** Beside the row's executable first: `UnityPlayer.dll` (else the shallowest one the walk listed) and
|
||||
`<exe>_Data` (else a `*_Data` beside that player); `<exe>.pck`. RPG Maker's files are looked for beside the executable and
|
||||
up to two folders above it, as `RpgMakerTitle` already looked for a title — a launcher-fronted game keeps its runtime in
|
||||
a subfolder (A Doll's Locket's `css\`, HELLO, HELLO WORLD!'s `swiftshader\`); a `Library=` that points outside the ini's
|
||||
folder is named and not read. Version resources and at most a few kilobytes of any file; the whole detection of one entry
|
||||
measured 24 ms to 4.1 s on the owner's USB drive, nearly all of it the install's walk, once per executable and rules
|
||||
version. The Privacy Policy says so since 2.8 (§4).
|
||||
|
||||
**What it is not.** RPG Maker 2000/2003 is not detected at all (no install to measure, no rule). XP and VX libraries are
|
||||
read by the VX Ace rule's reader unmeasured. A Unity build older than 2019 keeps its player in the executable (no
|
||||
`UnityPlayer.dll`): its data file's header is the only witness. Rules `2026.10.2` change the detection key, so every
|
||||
library entry is read again once; a Unity row keeps the old raw string only if none of its witnesses can be read now.
|
||||
|
||||
### Platform signatures & metadata
|
||||
|
||||
| Platform | Signals | Metadata |
|
||||
@@ -293,6 +334,29 @@ wrote, where detection wrote it.
|
||||
> is fetched (CLAUDE.md rule 8's "opt-in store metadata" is the online lookup, which does not exist). First-run
|
||||
> step 4 now points at File ▸ Import library… rather than saying "later build".
|
||||
|
||||
> **beta.19 (owner report 2026-10-12): a store's own pick can be a helper, and a launcher is not the game.** The owner's
|
||||
> A Doll's Locket - Remake (itch 5085165, RPG Maker MZ) was imported as `Dolls Locket\notification_helper.exe` — NW.js's
|
||||
> toast helper. The pick was **butler's verdict**, taken as is: butler stores a *filtered* verdict (the shallowest
|
||||
> candidates, minus those whose manifest asks for elevation) and does not rank what is left, and on that install the
|
||||
> 213 MB `DollsLocket.exe` launcher asks for administrator while the NW.js runtime sits a level deeper in `css\`, so the
|
||||
> helper was the whole verdict (read from the owner's `butler.db`, read-only). Three changes:
|
||||
> **(1)** a verdict candidate whose whole name is a runtime helper (`ExecutableLocator.RuntimeHelperNames`:
|
||||
> `notification_helper`, `crashpad_handler`, `UnityCrashHandler64/32`, `CrashReportClient`, NW.js's `nwjc` and
|
||||
> `chromedriver`) or that sits in a Unity plugin folder is skipped, and with nothing left the locator guesses and the
|
||||
> review marks the row *guessed* — whole names, because the locator's fragments are inside real games' names (`node` in
|
||||
> *Nodebuster*) and a store's pick is overruled only when it cannot be the game; the locator's `HelperFragments` gain the
|
||||
> same three NW.js names. **(2)** The locator ranks **an executable beside `nw.dll` + `package.json`** — the `rpgmaker_mv`
|
||||
> rule's own signal — as an NW.js runtime (owner decision D56), below the Unity and Unreal layouts (an NW.js folder can
|
||||
> be a tool shipped beside such a game) and above a name match (the launcher in front of the runtime is named after the
|
||||
> install): the install's guess is `css\Game.exe`, the process that draws, as D28 pointed HELLO, HELLO WORLD!'s entry at
|
||||
> its runtime by hand. That runtime starts elevated (its launcher asks for administrator), so it is measured with the
|
||||
> admin mode on (D34). **(3)** Discovery matches a store title to an entry by **platform + store id** as well as by
|
||||
> path: the entry an earlier import made at another executable is "already in the library" (the log names its path),
|
||||
> so a corrected guess never adds the same game a second time — that entry is re-pointed with Change executable…, and
|
||||
> nothing rewrites it by itself (D25/D27). Tests: `ExecutableLocatorTests.AnNwjsRuntimeBeatsTheLauncherNamedAfterTheInstallAndItsHelpersAreDropped`,
|
||||
> `StoreLibrarySourcesTests.ItchSkipsAVerdictCandidateThatIsARuntimeHelper` (the verdict as stored),
|
||||
> `LibraryImporterTests.AStoreTitleAlreadyInTheLibraryAtAnotherExecutableIsNotOfferedAgain`.
|
||||
|
||||
**Publisher/version order:** store manifest → PE `CompanyName`/`ProductVersion` → *(opt-in)* Steam `appdetails` lookup, cached 7 days. *(Since beta.8 the PE versions are stored beside the store's rather than instead of it — §What the files say about themselves; the page labels a store's value with its store, "Steam build 20374416".)*
|
||||
|
||||
## Capability hints (explicitly labelled as such)
|
||||
|
||||
@@ -47,8 +47,10 @@ CREATE TABLE games (
|
||||
store_id TEXT,
|
||||
engine TEXT, engine_version TEXT,
|
||||
-- (schema 0015, ALTERed last) engine_version_source TEXT: where engine_version came from — a
|
||||
-- Domain.Detection.EngineVersionSource id (unreal_branch_file | unreal_branch | unreal_file_version, or the rule's
|
||||
-- extractor type); NULL for a version the user typed. Written with the version only (05_DETECTION §Engine version)
|
||||
-- Domain.Detection.EngineVersionSource id (unreal_branch_file | unreal_branch | unreal_file_version; since beta.19
|
||||
-- unity_player | unity_data | unity_player_file | godot_pck | godot_pck_embedded | godot_exe | rpgmaker_mz_core |
|
||||
-- rpgmaker_mv_core | rgss1_library | rgss2_library | rgss3_library — the RPG Maker ids also name the maker; or the
|
||||
-- rule's extractor type); NULL for a version the user typed. Written with the version only (05_DETECTION §Engine version)
|
||||
publisher TEXT, game_version TEXT,
|
||||
cover_path TEXT, notes TEXT,
|
||||
removed_at INTEGER, -- schema 0002 (P3 PR-3): FR-1.4 "remove, keep sessions" — the row stays
|
||||
|
||||
+2
-2
@@ -406,8 +406,8 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `SessionHeld` | A→UI | **Added 2026-09-23.** 1 Hz while a client listens, for a session held unhooked only: `{ sessionGuid, elapsedS, gpuTempC?, cpuTempC?, gpuLoadPct?, cpuLoadPct?, gameVramDedicatedMb?, gameRamPrivateMb? }` — how long it has run and the machine's sensors (and since beta.12 the game process's own memory, read from outside it — optional, an older client ignores them). **Never `SessionProgress`**: its `presents5s`, `presentedQualifier` and `fgMode` are required, and zeros there would put measured-looking numbers on the wire for a session that measures nothing (rule 6 has nothing to show and shows nothing) |
|
||||
| `SessionProgress` | A→UI | 1 Hz: `{ sessionGuid, elapsedS, presents5s, presentedFps5s?, presentedQualifier, nativeFps5s?, displayedFps5s?, fgFactor?, fgMode, upscaler?, upscalerQuality?, upscalerDriverReported?, renderW/H?, outputW/H?, rtActive?, gpuTempC?, cpuTempC?, cpuLoadPct?, vramProcMb?, latencyUs?, fgRefusal?, fgRuntimeCensus?, gameVramDedicatedMb?, gameRamPrivateMb? }` (the last two added 2026-10-03, beta.12, optional: the game process's dedicated GPU memory and private working set, MiB, from the newest telemetry tick; `vramProcMb` stays reserved for the in-process figure and has no producer) — a 5 s rolling window over the ring through the SAME Domain calculators the row uses (`SessionProgressCalculator`, D13). **`upscalerDriverReported` added 2026-09-21, optional:** `dlss` when the NVIDIA driver reports an NGX super-resolution feature created and evaluated in the target (`03_METRICS` §The driver-reported rung), so the live card says `DLSS (driver-reported)` where no hook can name the upscaler; identity only. **`cpuLoadPct` added 2026-09-21, optional** (CPU time busy over the last telemetry tick, 0–100; `cpuTempC` has a producer from the same date, present only when the Agent is elevated with PawnIO). **Two fields added 2026-09-14, both optional (an older client ignores them, §C):** `fgRefusal` is the row's `fg_refusal` (schema 0003) — present when `fgMode` names a technology and `fgFactor` is absent, so the live card can say "DLSS-G active — factor not counted" rather than N/A; `fgRuntimeCensus` is the raw census so the `fg_runtime_loaded` chip can name the module. **Rule 6 at the wire (2026-09-13):** `nativeFps5s` / `displayedFps5s` / `fgFactor` are present only when frame generation was measured in the window; otherwise `presentedFps5s` stands alone with `presentedQualifier` (`census_not_run` · `no_fg_runtime` · `fg_runtime_loaded` · `none_withheld`, the row's `presented_qualifier` from the same function). Every unmeasured field is absent, never 0. Suppressed when no client is connected |
|
||||
| `SessionCompleted` | A→UI | `{ sessionGuid, sessionId?, exitStatus, tier, finalize, reason, gameId?, gameName? }` — UI loads the full row from SQLite; `sessionId` is null and `finalize` is `discarded` when the row was not stored (under the minimum length), or `game_removed` when its entry was removed with its sessions while it ran (2026-09-23), or **`faulted` when the session's task threw before it could finalize** (2026-09-23: it follows the `CaptureError SessionFaulted`, with `exitStatus` `interrupted` and `reason` `SessionFaulted`, so the live card and the tray let go of a session that no longer runs; the `.partial` stays for recovery); `exitStatus` is the row's vocabulary (`normal` · `crashed` · `unhooked_safety` · `degraded`); `reason` is the loop's `SessionEndReason`. **`gameId` / `gameName` added 2026-09-23, optional:** the entry the session was stored under — the finalizer's owner when it re-keyed a session whose entry was removed, else the one it started under — so the notice names the session that completed, not whatever the live card last showed |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason when it named a family; `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3); `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
|
||||
| `CaptureRefused` | A→UI | `{ gameId, gameName, reason, family?, signal?, hookingTurnedOff, guardReason? }` — **`guardReason` (beta.13, optional)** is the guard's own reason ~~when it named a family~~ **whenever it refused (beta.18; beside a family only until then)**: `BlockedService` / `BlockedDriver` is a finding on the PC, not in the game, and the notice says so (§S23-3), and a refusal no family names is said in the guard's words (`Formats.GuardSentence`) — it printed the end's name, "reason RefusedByGuard"; `reason` stays the session's end reason — **guard fired**; `hookingTurnedOff` (2026-09-22) is true when the finding turned the game's hooking off (`19_SAFETY` §What a finding does to the game); UI shows the plain-language explanation — ~~and the Tier-2 offer~~; there is no alternative measurement to offer, only the option to record the session unmeasured (`08_UI` §Safety events). *(Built: for `RefusedByGuard`, `RefusedPreviouslyBlocked`, `RefusedKillSwitch`, `PreScanCouldNotVerify` and, since 2026-09-21 (beta.4), `TargetUnreadable` — a protected process the Agent could not open (added 2026-10-04) — `PreScanCouldNotVerify` with no family, because "could not verify" is neither a hit nor a pass; `family`/`signal` are the verdict's. A game merely not enabled or not consented raises nothing: that is an ordinary Tier-2 row, not a refusal to explain.)* |
|
||||
| `CaptureDegraded` | A→UI | `{ sessionGuid, from: 1, to: 2, reason }` — Tier 1 → Tier 2 mid-flight, or overlay self-disabled. **Under a two-rung ladder this means measurement STOPPED**, not that it continued at lower fidelity, and the notice must say so. *(Since beta.18 it says the end in words, `Formats.EndReasonText`; it printed `reason` raw — "The hook stopped (WriterSelfDisabled); the session continues without measuring" — and a stop ends the session, it does not continue it.)* *(Built: `SupervisionLost`, `WriterSelfDisabled`, `WriterStoppedBlocklisted`, `WriterNeverInstalledHooks`, `SupervisionFaulted`, `KillSwitchEngaged` — `RecordedSessionEvents.Classify` is the table.)* |
|
||||
| `SafetyUnhook` | A→UI | `{ sessionGuid, family?, signal?, hookingTurnedOff, guardReason? }` — `guardReason` as on `CaptureRefused` (beta.13) — anti-cheat appeared mid-session; prominent UI notice; `hookingTurnedOff` as on `CaptureRefused`. *(Built: the verdict that FIRED, not the pass that started the session — `CaptureOutcome.Verdict` carries the supervisor's last verdict on this reason since 2026-09-13.)* |
|
||||
| `HookingTurnedOff` | A→UI | `{ gameId, gameName?, reason, family?, signal? }` — **since 2026-09-25 (beta.8):** the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) found anti-cheat in a game whose hooking the user had turned on, and turned it off. Not a session event — no session is running — so the UI's notice carries no "record without measuring" action, only Dismiss (`SafetyNoticeKind.HookingOff`). A finding on a game whose hooking was already off sends nothing: its page and its library card change, nothing the user switched on did. Additive: a client that does not know the type ignores it (§Versioning). |
|
||||
| `CaptureError` | A→UI | `{ sessionGuid?, code, message }` — `InjectFailed`, `RingVersionMismatch`, `AttachRefused`, ~~`EtwAccessDenied`~~ (struck 2026-09-13 with the tier), ~~`PresentMonMissing`~~ (retired with the tool, 2026-08-27 — a code naming an implementation nobody chose), `TelemetryUnavailable`, `DbWriteFailed`, `SessionFaulted` (the session's task threw before finalize; the `.partial` stays for recovery, and ~~no `SessionCompleted` follows~~ a `SessionCompleted` with `finalize: faulted` follows since 2026-09-23). *(Built: `RingVersionMismatch` for a layout / record-size / build-id refusal — the "restart the game after an update" case — `AttachRefused` for the rest of the ring's refusals, `InjectFailed` for a target that could not be started, pinned, read or singled out.)* |
|
||||
|
||||
+71
-12
@@ -27,7 +27,10 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
|
||||
> `ViewerModeTests`); the pill reads *Viewer — no Agent*, a persistent InfoBar names the folder, and every control that
|
||||
> would ask the Agent or change the PC is disabled — hooking, the exception's grant and withdrawal, re-enabling, Delete
|
||||
> all sessions, the kill switch, the admin mode, the logon task, the Vulkan layer, Start with Windows, the automatic
|
||||
> update check, Help ▸ Check for updates, Tools ▸ Update detection rules and the tray's Pause. The profile's own folder
|
||||
> update check, Help ▸ Check for updates, Tools ▸ Update detection rules and the tray's Pause — and, since beta.18,
|
||||
> every setting the Agent reads (the user-mode exception option and the three Recording numbers had been missed, and a
|
||||
> change said the capture agent would read it) and the update channel beside the update check
|
||||
> (`ViewerModeTests.EverySettingTheAgentReadsIsOffInAViewer`). The profile's own folder
|
||||
> is refused however it is spelled (case, separators, a relative path, a junction), as is a folder that does not exist;
|
||||
> a refusal is a message box and exit 2. The viewer's folder is its own single-instance key, so it runs beside the
|
||||
> profile's App. D6 is unchanged: the Agent's `--data-dir` stays under `--console`.
|
||||
@@ -44,12 +47,16 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
|
||||
> rendered — below; corrected 2026-10-04). It is information, not one of FR-11's documents:
|
||||
> nothing is accepted or recorded, and the Disclaimer points at it.
|
||||
>
|
||||
> **Help ▸ User guide, beta.12 (D44).** `guide/` — eight short English pages for players (install, record a game, read
|
||||
> your results, anti-cheat and safety, your data, questions and answers, the terms in plain words) — embedded in the
|
||||
> **Help ▸ User guide, beta.12 (D44).** `guide/` — ~~eight~~ short English pages for players (install, record a game, read
|
||||
> your results, anti-cheat and safety, your data, questions and answers, the terms in plain words; *since beta.17, D54,
|
||||
> also the screens, every setting, what to do when something goes wrong and the words the App uses — twelve pages,
|
||||
> and the wiki's End-user part*) — embedded in the
|
||||
> App (`Services.EmbeddedDocuments.Guide`, titles from each page's first heading) and shown in a `Windows/DocumentWindow`
|
||||
> with a page list, Limitations last; a link between guide pages opens the page in the window. Help ▸ Documentation is
|
||||
> *Online documentation*: the README at this build's source. `GuideDocumentsTests` holds every page listed and titled and
|
||||
> every link leading somewhere.
|
||||
> every link leading somewhere — and since beta.17 every section link (against the anchors the App's renderer gives the
|
||||
> target), the contents in the App's order, and that *Every setting* and *The screens* name every setting the Settings
|
||||
> page shows and every page and menu item of the main window.
|
||||
>
|
||||
> **Documents are rendered, beta.12 (owner request 4, D45).** Every Markdown document the App shows — the Legal Gate's
|
||||
> three texts, Help ▸ Limitations, the update notes, About's documents — is drawn by `Markdown/MarkdownRenderer`
|
||||
@@ -124,7 +131,7 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
|
||||
## Notifications policy
|
||||
|
||||
- **In-app, transient** (rules updated, export done, non-fatal capture warning): `ISnackbarService` snackbar, 4 s.
|
||||
- **In-app, persistent** (Agent offline, PawnIO missing, update downloaded): `ui:InfoBar` banner pinned above content with action button.
|
||||
- **In-app, persistent** (Agent offline, ~~PawnIO missing,~~ update downloaded, a viewer's folder, the safety notices): `ui:InfoBar` banner pinned above content with action button. *(Corrected 2026-10-07: no PawnIO banner was ever built — CPU temperature reads N/A, and Settings ▸ System says it needs the admin mode and PawnIO; the viewer's banner (D52) and the safety notices were missing from the list.)*
|
||||
- **System-level, app possibly minimized** (session saved with "View" action, capture error while in tray, update available): tray balloon/toast via H.NotifyIcon.
|
||||
- One event → exactly one channel; never duplicate the same event across snackbar *and* tray.
|
||||
|
||||
@@ -163,6 +170,26 @@ The Menu sits in its own row **below** the TitleBar (never inside the drag regio
|
||||
> reads as before. Tests: `SafetyNoticesTests.AServiceOrDriverIsOnThisPcAndAModuleIsInThisGame`,
|
||||
> `…AnUnhookSaysWhereTheFindingWasAndPromisesNoReEnable`, `Tier2ReasonTests`.
|
||||
>
|
||||
> **Every notice in words — beta.18** (found while writing the guide, beta.17). Three texts printed what only the code
|
||||
> knows. The gate's own refusals — *Disable all hooking*, a game blocked before — carry the gate's label where a finding
|
||||
> carries its family, and the kill switch's notice read *"kill switch was detected in this game (the global 'disable all
|
||||
> hooking' switch is on (FR-2.4); …). FrameLedger will not inject into it, and nothing overrides that."* They are said as
|
||||
> the session's end now (`Formats.EndReasonText`: "All hooking is switched off in Settings, so nothing was measured."),
|
||||
> never as a finding. A refusal no family names read *"The anti-cheat guard did not hook this game: reason
|
||||
> RefusedByGuard."*: the events carry the guard's own reason for every refusal since (`07_IPC`), and the sentence is its
|
||||
> words — "… the game is 32-bit, and the hook runs in 64-bit games only."; an older Agent's reads `End_RefusedByGuard`.
|
||||
> A 30 s re-scan that could not look while the game still ran read *"Capture stopped: Access is denied. was detected while
|
||||
> the game was running"*; it reads `Safety_Unhooked_Unnamed_Format` ("Capture stopped while the game was running — the
|
||||
> game's process could not be opened — and FrameLedger unhooked."). And `CaptureDegraded` printed its reason raw and said
|
||||
> the session went on — *"The hook stopped (WriterSelfDisabled); the session continues without measuring."* — where a stop
|
||||
> ends it: the notice is the end's own sentence ("The measuring hook turned itself off after repeated faults, so measuring
|
||||
> stopped."), and `Notice_Degraded_Unknown_Format` names only a reason this build has no words for. Tests:
|
||||
> `NoticesFromTheAgentTests` builds each event as the Agent does — the gate's verdicts, the native facade's
|
||||
> (`AntiCheatVerdict.FromNative`), `RecordedSessionEvents.PublishReason`, the wire's codec — walks every refusal and every
|
||||
> stop, and refuses an enum's name, a requirement's id or "reason X" in any notice; it went red on the unfixed code with
|
||||
> exactly the texts above. Until then the notices' tests raised events written by hand ("GuardBlocked", "HookFaulted", a
|
||||
> guard reason sent as the end), which no Agent sends.
|
||||
>
|
||||
> **Corrected 2026-09-14, after the owner saw a red bar with no way out.** WPF UI 4.3.0's `InfoBar` template has
|
||||
> **no `ContentPresenter`**, so the action button above — placed as the InfoBar's Content, the only dismissal once
|
||||
> `IsClosable="False"` removed the X — was never rendered. The view model was right and the screen was wrong.
|
||||
@@ -272,7 +299,10 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> fields), **the row's executable path under the subtitle and Change executable… since 2026-09-21** (a store import
|
||||
> guesses the executable and everything downstream is keyed on it; the pick re-points the row, which comes back
|
||||
> hooking-off and unconsented like a new game, consent revoked over the pipe first, a block never cleared —
|
||||
> `05_DETECTION` §Library import), **one App per data folder since 2026-09-21** (`Services.SingleInstance`: a named mutex and a named event keyed on a hash of the data directory, claimed in `Program.Main` after Velopack's hooks and before any window; a later start sets the event and exits 0, and the first instance brings its window forward through `ShellHost.Reveal` — from the tray too. Nothing stopped a second App before: the owner's log shows two started 360 ms apart, two tray icons, a second log file. `--diag` never claims), ~~**the guard-bypass switch since 2026-09-21**~~ **withdrawn 2026-09-22** (the card, its dialog, the session mark and the export line are gone; a blocked row's toggle is disabled and `Safety_Blocked_Toggle_Format` is the whole story; a refusal or unhook notice that turned hooking off ends with `Safety_HookingTurnedOff` — `19_SAFETY` §What a finding does to the game), **Supports** (from `capability_flags`; ~~empty until P4's scan writes it, and the card says so~~ **written by the Agent's detection sweep since P4 PR-1, 2026-09-14** — the rule ids as product names via `CapabilityNames`, "not scanned yet" only until the Agent's next tick) beside
|
||||
> `05_DETECTION` §Library import; **since beta.19 the file dialog opens in the game's own folder** — `GameFolder.StartFolder`:
|
||||
> the store boundary's install folder (`InstallRoot`), an Unreal package's root above `<Project>\Binaries\Win64`, else
|
||||
> the executable's folder, and the nearest folder still there when that one is gone; nothing for a drive that is not
|
||||
> connected, where Windows opens its last folder; owner request 2026-10-12, `GameFolderTests`), **one App per data folder since 2026-09-21** (`Services.SingleInstance`: a named mutex and a named event keyed on a hash of the data directory, claimed in `Program.Main` after Velopack's hooks and before any window; a later start sets the event and exits 0, and the first instance brings its window forward through `ShellHost.Reveal` — from the tray too. Nothing stopped a second App before: the owner's log shows two started 360 ms apart, two tray icons, a second log file. `--diag` never claims), ~~**the guard-bypass switch since 2026-09-21**~~ **withdrawn 2026-09-22** (the card, its dialog, the session mark and the export line are gone; a blocked row's toggle is disabled and `Safety_Blocked_Toggle_Format` is the whole story; a refusal or unhook notice that turned hooking off ends with `Safety_HookingTurnedOff` — `19_SAFETY` §What a finding does to the game), **Supports** (from `capability_flags`; ~~empty until P4's scan writes it, and the card says so~~ **written by the Agent's detection sweep since P4 PR-1, 2026-09-14** — the rule ids as product names via `CapabilityNames`, "not scanned yet" only until the Agent's next tick) beside
|
||||
> **Last session measured** (upscaler · resolution, frame generation, the non-N/A chips — accent pills, from the
|
||||
> hooks). Hooking: the toggle is `OneWay` from the row and its command runs `HookingConsent`; a refusal, a
|
||||
> mismatch or a failure is a persistent `InfoBar` on the page (never a toast); a blocked row disables the
|
||||
@@ -347,6 +377,13 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> `FormatsTests`, and the page renders in `PagesLoadTests`. **The Details card's *NVIDIA App override* row** (same day)
|
||||
> is the newest session that read a driver profile, in the same words; no row where none did. Tests:
|
||||
> `NvidiaOverridesTests`, `GameDetailViewModelTests.TheDetailsCardNamesTheNvidiaAppsOverridesFromTheNewestSessionThatReadThem`.
|
||||
> **The *Engine* row carries the version, and an *Engine version* row says what it was read from** (beta.10 for Unreal;
|
||||
> beta.19 for Unity, Godot and RPG Maker — `05_DETECTION` §Engine version): the player library, the data file's header, a
|
||||
> data pack, a core script or the RGSS library `Game.ini` names, and *Not found in the game's files* once the Agent has
|
||||
> read such a title and found none. RPG Maker's witness names the maker on the page, the subtitle and the library card
|
||||
> (*RPG Maker MZ 1.10.0*, *RPG Maker VX Ace (RGSS 3.0.1)*; `Formats.Engine(id, source)`). Tests:
|
||||
> `GameDetailViewModelTests.TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom`,
|
||||
> `FormatsTests.TheVersionsWitnessNamesTheMakerAndRgssSaysWhoseNumberItIs`.
|
||||
- Tabs (WPF `TabControl`, Fluent-styled):
|
||||
1. **Sessions** — `DataGrid`: date, duration, **tier badge (T1/T2)**, Native, Displayed, FG×, 1% Low, 0.1% Low, resolution + upscaler, max GPU temp, API, chips, ⚠ crash badge, tags. Row → Session summary. ~~Multi-select → "Compare".~~ (not built; Compare's own picker chooses) Tier-2 rows render ~~`—`~~ `N/A` (not blank, not zero) in Tier-1-only columns, with a tooltip explaining why *(corrected 2026-10-04: as built — `—` means a measured none, §FPS display rule)*.
|
||||
2. **Frametime** — ScottPlot timeline of selected session (decimated), stutter markers, sensor overlay toggle (temp on right axis).
|
||||
@@ -604,13 +641,19 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
### Settings
|
||||
> **beta.14 (owner request 2026-10-05: "an option to hide the scroll bars but still scroll").** The Window section has
|
||||
> **Hide scroll bars** (`ui.hide_scrollbars`, off by default). A bar's visibility is bound inside its scroller's template,
|
||||
> which no style reaches, so `Services.ScrollBarHiding` sets the scrollers themselves: one class handler on
|
||||
> `ScrollViewer`'s Loaded (registered at start beside `DialogKeyboard`) reaches every scroller the App shows, those inside a
|
||||
> DataGrid, a TextBox, a rendered document and a dialog included. While on, an axis that is `Auto` or `Visible` becomes
|
||||
> which no style reaches, so `Services.ScrollBarHiding` sets the scrollers themselves: ~~one class handler on
|
||||
> `ScrollViewer`'s Loaded (registered at start beside `DialogKeyboard`) reaches every scroller the App shows~~ class
|
||||
> handlers on `ScrollViewer`'s ScrollChanged and Loaded (registered at start beside `DialogKeyboard`) reach every scroller
|
||||
> the App shows *(corrected 2026-10-07, beta.17, the owner's screenshot of the Dashboard with its bar: WPF raises Loaded
|
||||
> only where a subtree listens for it with a handler of its own, and a class handler is not one — `16_WPFUI_SYNTAX`
|
||||
> §Gotchas. Settings, full of toggle switches whose template listens, lost its bar; the Dashboard, the first run, About,
|
||||
> the user guide and a game's wide sessions table kept theirs. Every scroller raises ScrollChanged from its first layout)*,
|
||||
> those inside a DataGrid, a TextBox, a rendered document and a dialog included. While on, an axis that is `Auto` or `Visible` becomes
|
||||
> `Hidden` — WPF's "no bar, still scrolls": wheel, keyboard and touch — and its own value is kept on it; a `Disabled` axis is
|
||||
> never touched (it lays its content out at the viewport's width). The toggle applies to the open windows at once, and off
|
||||
> puts every kept value back. Tests: `ScrollBarHidingTests` (on hides every bar and the wheel still scrolls; off restores
|
||||
> each; a scroller that loads later follows), `SettingsViewModelTests.HidingScrollBars…`.
|
||||
> each; a scroller that loads later follows; since beta.17 a scroller laid out with no Loaded at all, and every page,
|
||||
> window and dialog shown in a real window with the option on), `SettingsViewModelTests.HidingScrollBars…`.
|
||||
|
||||
> **beta.11 (owner request 2026-10-03: "remove the Settings rows that have no button or similar").** Every row has a control
|
||||
> now: the *Games with hooking on* card shows only while a game has hooking on (its empty sentence is gone); the *Elevation*
|
||||
@@ -639,7 +682,8 @@ Agent section: elevation state with a plain explanation of what elevation *optio
|
||||
> **Built 2026-09-14 (P3 PR-8a), with three rows deferred to PR-8b and one to PR-9.** `SettingsViewModel` over
|
||||
> `Application.Settings.RegisteredSettings` (the registry of `06_DATA_MODEL` §Settings registry — every write is
|
||||
> one `settings` row, and a key the Agent reads gets the 4 s "Applied. The capture agent reads it at the next
|
||||
> session start" line, D16). **Capture, first:** the kill switch as a `CardExpander` whose header is the toggle
|
||||
> session start" line, D16 — but for turning the kill switch on, which says a game being measured stops at its next
|
||||
> safety scan, within 30 seconds: beta.18; until then it said the next session start). **Capture, first:** the kill switch as a `CardExpander` whose header is the toggle
|
||||
> and whose state line says "All hooking is off" / "Per-game settings decide" — it is `hooking.kill_switch`, the
|
||||
> gate's fourth input (`CaptureSession` consults it at every 30 s re-scan, so a running measured session stops at
|
||||
> its next scan; nothing else needs pushing); the hook-enabled list is `games.hook_enabled` as the ledger has it,
|
||||
@@ -759,7 +803,8 @@ the requirement was one bullet under §UX rules, and nothing checked it.
|
||||
| **Arrows, Home/End, Page Up/Down** | Move within a `DataGrid` (Sessions, Compare picker, Import checklist) | `DataGrid` defaults |
|
||||
| **Esc** | Closes the open `ContentDialog` or `MessageBox` with no result — the same as its Close/Cancel button | `DialogKeyboard`, one class handler per dialog type registered at start-up |
|
||||
|
||||
**Esc is the Close button, never the primary one.** On the consent dialog (FR-2.1) that is "Keep it off": nothing is
|
||||
**Esc is the Close button, never the primary one.** On the consent dialog (FR-2.1) that is ~~"Keep it off"~~ "Keep hooking
|
||||
off" *(the button's text, corrected 2026-10-07)*: nothing is
|
||||
stamped. A dialog that offers no Close button is not dismissed by Esc, and the Legal Gate (FR-11) is a window of its own
|
||||
(`FirstRunWindow`) with explicit Decline and Accept, on which Esc does nothing. WPF UI 4.3.0 handles no key in
|
||||
either dialog type (its `ContentDialog.cs` and `MessageBox.cs` at tag 4.3.0 have no key handler — read 2026-09-15),
|
||||
@@ -834,6 +879,20 @@ palette per theme, chosen with the theme).
|
||||
> summary, every dialog's content and the safety InfoBar, made under one theme, switched, and compared text by text with
|
||||
> the same surface made fresh under the other — both ways). Both went red on the unfixed XAML, the second with 146 stale
|
||||
> texts each way, before they went green.
|
||||
>
|
||||
> **A fifth hole, closed 2026-10-07 (beta.18; the owner's screenshots of beta.17 in the dark theme: every page's title and
|
||||
> section headings near-black on the dark window — beta.16's screenshot shows it too).** This text had no colour of ours,
|
||||
> because it had none. A page is shown in WPF UI's `NavigationViewContentPresenter`, a `Frame`, and a Frame passes no
|
||||
> inherited value into its page (`InheritanceBehavior.SkipToAppNow`), so a text that sets no colour falls to the TextBlock
|
||||
> default, which WPF UI 4.3.0 makes black (`16_WPFUI_SYNTAX` §Gotchas). Cards, grids and controls set their own; the bare
|
||||
> titles and headings did not: 19 texts on the six pages at 1.29:1. Every check above laid a page out straight in a
|
||||
> window, whose text colour the page then inherited — a page the App never draws — and a page on screen during a theme
|
||||
> switch did take the window's colour, while each navigation makes a new one that does not, so it came and went. Every
|
||||
> page sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"` on its root. Held two ways:
|
||||
> `AccessibilityTests.EveryPageSetsItsOwnTextColour`, and `PagesLoadTests.EveryTextIsReadableInBothThemes` — every
|
||||
> surface hosted as the App hosts it, a page in the presenter, and every text that shows ≥ 3:1 over the colour painted
|
||||
> under it, in both themes. `EveryTextFollowsAThemeSwitch` hosts its pages in the presenter too since, and went red with
|
||||
> them: a page made after a switch stayed black. All three went red on the unfixed XAML before they went green.
|
||||
|
||||
### DPI
|
||||
|
||||
|
||||
@@ -272,6 +272,16 @@ substitutes it with ~~the tag date~~ the run's UTC date (corrected 2026-10-04) w
|
||||
address — is resolved in the source files, because an unsubstituted token in a
|
||||
document the app displays for acceptance (FR-11) is a defect, not a template.
|
||||
|
||||
**The build id is read before it (beta.18).** The substitution edits tracked files, and the native build id is
|
||||
`git describe --dirty` at CMake's configure (`src/native/FrameLedger.Shm/CMakeLists.txt`): every release until beta.18
|
||||
shipped `<tag>-dirty` — the owner's Dashboard read *Overlay build v0.1.0-beta.17-dirty*, and that run's log printed
|
||||
`FL_BUILD_ID = v0.1.0-beta.17-dirty` two lines after `RELEASE_DATE = 2026-10-07 in 3 file(s)`. `release.yml` now reads
|
||||
describe from the clean checkout first, refuses one that is already dirty or longer than 31 characters, and passes it
|
||||
as the environment's `FL_BUILD_ID`, which CMake takes as given (checked for the characters a C string literal carries);
|
||||
after the publish, `tools/buildid-check.ps1` reads it back out of the four native binaries that compile it, by their
|
||||
bytes — nothing is loaded. A developer's build still runs describe itself (`+` marks a dirty tree when the long form
|
||||
would not fit).
|
||||
|
||||
## Local quality gate (pre-push)
|
||||
|
||||
`./build.ps1 check`:
|
||||
@@ -298,8 +308,10 @@ document the app displays for acceptance (FR-11) is a defect, not a template.
|
||||
13b. `tools/accuracy-check.ps1 -SelfTest`, then live — the accuracy block is ONE text (`legal/ACCURACY.md`) embedded verbatim in `README.md` and `legal/DISCLAIMER.md` §4; a copy that drifted, a copy with no markers, or an empty source is red. Four self-test cases, both directions (§S23-6, 2026-09-06)
|
||||
13c. **`tools/notice-check.ps1 -SelfTest`, then live** (beta.12, owner decision D45, 2026-10-03) — every first-party source file (`.cs .cpp .h .inl .ps1 .xaml`, tracked or new, minus `src/native/third_party/`) opens with `SPDX-License-Identifier: GPL-3.0-only` and `Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE` in its own comment syntax, because GPLv3 §7 wants additional terms named "in the relevant source files" (`NOTICE` carries them); the second line may name another holder and year in the same form (a contributor's own file).
|
||||
Seven self-test cases, both directions; `./tools/notice-check.ps1 -Fix` writes a missing header, and `tools/resx-gen.ps1` generates the accessor with it
|
||||
13d. **`tools/wiki-build.ps1 -SelfTest`, then `-Check`** (beta.17, owner decisions D53/D54, 2026-10-07) — assembles the GitHub Wiki from `wiki/`, `guide/` and `LIMITATIONS.md` into a temporary folder, as `wiki.yml` does at a release (`13_CI_CD` §wiki.yml), and fails on a link to a file, folder or section that does not exist, two sources for one page, a page that neither Home nor the sidebar leads to, a sidebar that lists the guide in another order than `guide/README.md`, a backticked repository path in a `wiki/` page that names nothing, and a version number written into a `wiki/` page (the footer says which release the wiki shows). Nine self-test cases, both directions
|
||||
14. `tools/changelog-check.ps1 -SelfTest` — nine cases, five expected RED. The live half needs a pull request's changed-file list and is supplied by `ci.yml`
|
||||
14b. `tools/release-notes.ps1 -SelfTest` — five cases over a fixture changelog (a dated and an undated section, a missing one, a prefix that must not match, an empty one). The live half needs a tag's version and runs in `release.yml`, where a missing or empty section is a red release (P4 PR-5)
|
||||
14c. **`tools/buildid-check.ps1 -SelfTest`** (beta.18) — eight cases, both directions: a binary built from a dirty tree (`-dirty`, or the short form's `+`), one with no id, a missing one, and an expected id that is dirty or not an id are red. The live half needs the release's clean-checkout id and runs in `release.yml` over the published tree (§Release-time token substitution)
|
||||
15. `tools/resx-audit.ps1` — ~~**skipped loudly; it does not exist, and no `.resx` file does either**~~ **built 2026-09-13 (P3 PR-2)**: `-SelfTest` first (11 fixture cases, both directions), then the live pass over every `Strings.resx` family under `src/` — key sets equal across en/vi/ja, `Safety_*` in `ja` marked for review or signed, `Strings.Designer.cs` current with `tools/resx-gen.ps1`. A tree with no family is red (`09_I18N` §Translation workflow)
|
||||
16. **struct-mirror** — reads this run's `.trx` and fails when `ShmLayoutMirrorTests` did not execute, so deleting the mirror test is red as well as breaking it
|
||||
16b. **`tools/test-artifacts-check.ps1`** — `-SelfTest` first (seven cases, two RED), then live: an `overlay-*.log` created since this gate started, still in the real `%LOCALAPPDATA%\FrameLedger\logs` after the tests, whose first line names a `hook-harness*` image, fails the gate. It is what makes a test binary without its log sweep red (`17_HOOK_ENGINE` §Native logging, 2026-09-15); a game's log never counts
|
||||
|
||||
+40
-1
@@ -52,6 +52,17 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
case. `Kill` now waits for exit (bounded, asserted) and the delete retries. Not §S19(b) either — a test-harness
|
||||
race, and the third flake shape of the day (the registry-subtree race between `VkLayerRegistrationTests` and the
|
||||
GOG reader's test, fixed in #188) was the same kind.
|
||||
- **Two more on 2026-10-07 (beta.18), both re-run green and then fixed the same day.**
|
||||
`WhenTheTargetExitsTheHostStopsAndSaysWhy` ended **`TargetNotRunning`** (#286, run 37619719203): the host resolves its
|
||||
target once, as it starts, and a host slower than the harness's 6 s hold found it gone — the shape recorded since
|
||||
2026-09-21. The hold is 15 s: a margin, not a signal, because the host prints nothing until its session ends.
|
||||
`LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing` ended **`RefusedByGuard` / `ModuleScanFailed`**
|
||||
(#288, run 37627351438): the hosted runner has the Vulkan loader and no device, so the harness exits 77 with a
|
||||
`[SKIP]` line — but the runner is elevated, the host starts the harness through `CreateProcessWithTokenW`
|
||||
(`UnelevatedProcess`), the child gets no stdout, and the line never reached the host's output; the test then
|
||||
depended on the session reading `LaunchTargetExited`, and a scan that hit the dying harness failed it instead. The
|
||||
test now asks the harness directly, before the host runs (exit 77 = skip, with the harness's own line); hiding the
|
||||
Vulkan ICDs from that probe makes it skip in under a second, and on a machine with a device it runs in full.
|
||||
- **A re-run ERASES the evidence, which is why the count above had to be kept by hand.**
|
||||
`gh run rerun --failed` updates the original run's conclusion, so `gh run list` showed **18 success, 1
|
||||
cancelled, 0 failed** across the twenty runs that contained all three failures above. Anyone measuring
|
||||
@@ -127,6 +138,10 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
`VERSION` file (`12_BUILD` §Version); and `CHANGELOG.md` must carry a **non-empty** `## [x.y.z]` section for the
|
||||
full version, extracted by `tools/release-notes.ps1` (self-tested on every `build.ps1 check`). A missing
|
||||
section is a red release, not an empty note — the ledger's header said the opposite for five weeks.
|
||||
- **The build id from the clean checkout** (beta.18): `git describe --always --dirty --abbrev=12` before anything edits a
|
||||
tracked file — a dirty one or one over 31 characters stops the run — into `FL_BUILD_ID` for CMake. Until beta.18 the
|
||||
substitution below ran first and every release's natives called themselves `<tag>-dirty` (`12_BUILD` §Release-time
|
||||
token substitution).
|
||||
- `{{RELEASE_DATE}}` substituted in `legal/*.md` with the run's UTC date **before the build**, because the App
|
||||
embeds those documents (FR-11); any `{{` token left anywhere after that fails the job.
|
||||
- **The identical gate** — `./build.ps1 check`, native first, every tool including `versioninfo-check` against
|
||||
@@ -184,6 +199,29 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
- **The `anticheat` block gets extra scrutiny:** schema-valid, non-empty, no entry removed without a justification in the PR body. Removing a blocklist entry is a safety change and requires the same review as a security fix. *(Added 2026-10-04: the PR-only removal step fails the job on any removal, a shrunk per-title list or an added trusted signer, whatever the body says — the justification is for the reviewer, and the job stays red.)*
|
||||
- `permissions: contents: read`.
|
||||
|
||||
### `wiki.yml` — after a successful Release run, and by hand · **repo-local, built 2026-10-07 (beta.17, D53/D54)**
|
||||
- **What:** the GitHub Wiki is a copy of the repository's own pages — `wiki/` (Home, the sidebar, the developer pages)
|
||||
and `guide/` (the user guide: the End-user part, the same pages the App shows) with `LIMITATIONS.md`.
|
||||
`tools/wiki-build.ps1` names each page (a guide page after its first heading, `guide/README.md` as *User-guide*,
|
||||
`LIMITATIONS.md` as *Limitations*), rewrites links between pages to page names and every other repository link to
|
||||
its address on GitHub **at the release's tag**, drops each page's first heading (the wiki prints the page name), and
|
||||
writes a footer naming the tag. The same assembly is `build.ps1`'s `wiki-check` gate (`12_BUILD` §Local quality gate,
|
||||
13d), so a dead link is red on the pull request, never on the published wiki.
|
||||
- **When:** `workflow_run` on `Release`, completed — the job runs only when that run succeeded and was started by a
|
||||
pushed `v*` tag, so a `workflow_dispatch` rehearsal of `release.yml` never publishes. It checks out the run's
|
||||
`head_sha` (a `workflow_run` job runs `main`'s copy of this file) and links at `head_branch`, the tag. By hand:
|
||||
`gh workflow run wiki.yml -f ref=main -f publish=false` builds, checks and uploads the pages as an artifact; with
|
||||
`publish=true` it publishes them.
|
||||
- **Why not a step of `release.yml`:** the release stays as it was, its rehearsal stays a pure rehearsal, and a wiki
|
||||
that fails to publish is a red run of its own that can be re-run — a step after `gh release create` could never be
|
||||
re-run, the release already existing. A release created with `GITHUB_TOKEN` fires no `release` event for other
|
||||
workflows; `workflow_run` fires because the Release run itself was started by a tag push.
|
||||
- **Publishing:** `gh auth setup-git`, a clone of `<repo>.wiki.git`, everything but `.git` replaced, a commit as
|
||||
`github-actions[bot]` only when something changed, `git push origin HEAD:master` (the wiki's branch is `master`). A
|
||||
page edited on the Wiki tab is overwritten at the next release: edit `wiki/` or `guide/`.
|
||||
- `permissions: contents: write` — the repository's default workflow token is read-only (read from the API,
|
||||
2026-10-07), and pushing to the wiki repository needs write.
|
||||
|
||||
## Dependabot (`.github/dependabot.yml`)
|
||||
|
||||
```yaml
|
||||
@@ -215,7 +253,7 @@ Central package management makes Dependabot PRs single-file diffs.
|
||||
|
||||
**In the tree — done:**
|
||||
|
||||
- [x] Repo-local `ci.yml`, `codeql.yml`, `release.yml`, `rules-publish.yml` (all four repo-local by decision, §Workflows); ~~caller stubs pointing at `poli0981/.github`~~ — never the design, see the first paragraph
|
||||
- [x] Repo-local `ci.yml`, `codeql.yml`, `release.yml`, `rules-publish.yml` (all four repo-local by decision, §Workflows); ~~caller stubs pointing at `poli0981/.github`~~ — never the design, see the first paragraph *(and `wiki.yml` since beta.17, repo-local too: five)*
|
||||
- [x] Issue forms `bug_report.yml`, `feature_request.yml`, `safety_gap.yml`; `ISSUE_TEMPLATE/config.yml` pointing a vulnerability at private reporting; PR template referencing CLAUDE.md's definition of done
|
||||
- [x] `.github/dependabot.yml` (nuget + github-actions, weekly)
|
||||
- [x] `SECURITY.md` — the private route for a vulnerability, the public route for a safety gap, and the honest response intent (2026-09-16)
|
||||
@@ -227,4 +265,5 @@ Central package management makes Dependabot PRs single-file diffs.
|
||||
- [ ] `Rules / validate` as a required check (§S23-2, after its skip-shim)
|
||||
- [ ] Dependabot alerts + security updates (the manifest is in the tree; the alerts are a setting)
|
||||
- [x] Private vulnerability reporting enabled (Settings ▸ Security), so `config.yml`'s link resolves *(marked 2026-10-04: GitHub reports it enabled)*
|
||||
- [ ] Wiki editing restricted to collaborators (Settings ▸ General ▸ Features ▸ Wikis ▸ *Restrict editing to collaborators only*): otherwise anyone with a GitHub account can change a page until the next release overwrites it (§wiki.yml, beta.17)
|
||||
- [ ] Repo topics: `windows`, `wpf`, `benchmark`, `fps`, `game-performance` (~~`presentmon`~~ — dropped 2026-08-27, §G)
|
||||
@@ -71,6 +71,26 @@ under the new theme. `PagesLoadTests.Surfaces` builds every page, window and dia
|
||||
any check that wants all of them. Colours are compared and texts only reported: another test class may change
|
||||
`Strings.Culture` between the two builds.
|
||||
|
||||
**A page is measured in the Frame the App shows it in, and a theme brings its accent (beta.18).** WPF UI's
|
||||
`NavigationViewContentPresenter` is a `Frame`, which passes no inherited value into the page, the text colour included, so
|
||||
a page laid out straight in a window measures the window's colour and not the App's: the theme-switch check above did, and
|
||||
stayed green over every page title drawn black (`08_UI` §Contrast, fifth hole). The rendered checks host a page in the
|
||||
presenter (`PagesLoadTests.Hosted`), and `PagesLoadTests.EveryTextIsReadableInBothThemes` measures every surface's shown
|
||||
texts at ≥ 3:1 in both themes. `Visuals.UnderTheme` switches as the App does — the accent resources derived for the theme
|
||||
from Windows' default accent (`Visuals.DefaultAccent`, the App's derivation rather than the machine's own palette), then
|
||||
the dictionary — and puts the application's own resources back afterwards. The accent lives in `Application.Resources`,
|
||||
not in a theme dictionary; until then a check under Light measured the dark theme's link blue on the light window, 1.9:1,
|
||||
a colour the App never shows. The theme-switch check compares what can be seen: a text only one of the two instances holds
|
||||
counts where it shows, and a collapsed part is not compared (a switch re-applies the template of a DataGrid's idle scroll
|
||||
bar, and its glyphs exist in the switched instance only).
|
||||
|
||||
**Loaded needs a shown window, and even then it is not raised everywhere (beta.17).** A tree laid out by hand never raises
|
||||
Loaded, and a shown one raises it only where a subtree listens for it (`16_WPFUI_SYNTAX` §Gotchas) — so a test that calls
|
||||
`RaiseEvent(Loaded)` proves a handler, never that WPF reaches it. `ScrollBarHidingTests.EverySurfaceShownWithTheOptionOnDrawsNoBar`
|
||||
shows each surface in a real window, off the screen and never activated, with the option on before anything is built as
|
||||
at start-up; `WpfRaisesLoadedOnlyWhereASubtreeListensForIt` checks the harness against WPF itself (a scroller holding a
|
||||
Border is never loaded, one holding a CheckBox is), on CI too.
|
||||
|
||||
**A test that sends input must also say which keys are held.** `Keyboard.Modifiers` is the machine's real keyboard, read
|
||||
from any thread (a fresh background thread's `GetKeyState` reports the machine's NumLock — measured 2026-10-06), so a
|
||||
wheel test that read it held whatever key a person pressed while the gate ran: `ChartWheelTests`' plain half went red once
|
||||
|
||||
+24
-1
@@ -152,6 +152,8 @@ Native `Menu`, `TabControl`, `ComboBox`, `Slider`~~, `ListView`~~ are fine — t
|
||||
styles (`Styles/FrameLedger.xaml`), or the `Pill` style with a `SystemFillColor*BackgroundBrush` and an explicit text
|
||||
brush; `ContrastTests` refuses all five (`08_UI` §Contrast).
|
||||
- Do **not** set `Background` on `FluentWindow` (kills Mica). Page backgrounds transparent by default.
|
||||
- **Every `Page` root sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"`** (2026-10-07): the navigation's
|
||||
Frame passes no text colour into a page, and a text with none is black (§Gotchas).
|
||||
- Exception to the no-hex rule: the chart palette — defined once per theme in ~~`Styles/ChartPalette.xaml` (two dictionaries)~~ `Styles/ChartPalette.Dark.xaml` and `ChartPalette.Light.xaml` (corrected 2026-10-04), never inline.
|
||||
|
||||
## FlowDocument (rendered documents, beta.12)
|
||||
@@ -254,7 +256,17 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
|
||||
- [ ] **A scroll bar's visibility is bound inside its scroller's template** (`ComputedVerticalScrollBarVisibility`), so a style
|
||||
on `ScrollBar` or `ui:DynamicScrollBar` cannot hide it. Set the scroller's own `ScrollBarVisibility` to `Hidden` — no
|
||||
bar, and the wheel, the keyboard and touch still scroll (`ui:PassiveScrollViewer` treats only `Disabled` as "cannot
|
||||
scroll") — as `Services.ScrollBarHiding` does for `ui.hide_scrollbars` (beta.14).
|
||||
scroll") — as `Services.ScrollBarHiding` does for `ui.hide_scrollbars` (beta.14), reaching each scroller from a class
|
||||
handler on `ScrollChanged` since beta.17 rather than from `Loaded` alone (next item).
|
||||
- [ ] **A class handler on `Loaded` is not a load hook.** WPF raises Loaded only on an element whose subtree listens for it
|
||||
with a handler of its own — an instance handler, a style's `EventSetter`, a template's trigger
|
||||
(`BroadcastEventHelper.OnBroadcastCallback` walks only into `SubtreeHasLoadedChangeHandler`;
|
||||
`FrameworkElement.ThisHasLoadedChangeEventHandler`) — and `EventManager.RegisterClassHandler` counts as none of them.
|
||||
WPF UI 4.3.0's `ToggleSwitch`, `CheckBox` and `ProgressRing` templates carry a Loaded trigger, so a scroller over those
|
||||
loads and a scroller over plain cards and text never does: `ScrollBarHiding` hid Settings' bar and not the Dashboard's
|
||||
(beta.17). To reach every instance, hook an event the element raises itself — a scroller's `ScrollChanged` comes from its
|
||||
first layout. `ScrollBarHidingTests.WpfRaisesLoadedOnlyWhereASubtreeListensForIt` keeps the behaviour visible, and a test
|
||||
that raises Loaded with `RaiseEvent` proves the handler, never that it is reached.
|
||||
- [ ] **No dialog in 4.3.0 closes on Esc.** Neither `ContentDialog.cs` nor `MessageBox.cs` at the 4.3.0 tag handles a
|
||||
key (read 2026-09-15), and `ContentDialog.CloseButtonText` DEFAULTS to "Close" — an empty string is how a dialog
|
||||
says it has no Close button. `MessageBox.Close()` is `[Obsolete("Use Close with MessageBoxResult instead")]` while no
|
||||
@@ -270,3 +282,14 @@ On startup and on `ApplicationThemeManager.Changed`: for every live plot set fig
|
||||
`DynamicResource`). `ContrastTests.NoTextBlockTakesItsColourFromAppearance` refuses every form in the App's XAML and code,
|
||||
`PagesLoadTests.EveryTextFollowsAThemeSwitch` renders every surface through a switch both ways, and
|
||||
`PagesLoadTests.WpfUisAppearanceStillKeepsTheThemeATextWasMadeUnder` turns red the day upstream follows a switch.
|
||||
- [ ] **A page in the `NavigationView` inherits nothing, its text colour included.** `NavigationViewContentPresenter` is a
|
||||
`Frame`, and `Frame` sets `InheritanceBehavior.SkipToAppNow`: the window's `Foreground` stops there, and a text that sets
|
||||
no colour falls to the TextBlock default, which WPF UI 4.3.0's `TextBlockMetadata` makes `Brushes.Black`. Cards, grids
|
||||
and controls set their own colour in their templates; the bare texts did not — every page's title and section headings
|
||||
were black on the dark window, 1.3:1 (the owner's screenshots of beta.17; beta.16's show it too). It came and went: a
|
||||
page on screen during a theme switch did take the window's new colour through the switch, and every navigation makes a
|
||||
new page that does not. Every `Page` root sets `Foreground="{DynamicResource TextFillColorPrimaryBrush}"`
|
||||
(`AccessibilityTests.EveryPageSetsItsOwnTextColour`). A check that lays a page out straight in a window measures the
|
||||
window's colour, not the App's — beta.17's theme-switch check did and was green over the black titles — so the rendered
|
||||
checks host a page in the presenter, and `PagesLoadTests.EveryTextIsReadableInBothThemes` measures every surface so
|
||||
hosted at ≥ 3:1 in both themes.
|
||||
+102
-3
@@ -1410,9 +1410,11 @@ stops there"~~ — the override itself is gone since 2026-09-22 (D22).
|
||||
**Found and NOT fixed — each needs its own PR.**
|
||||
- ~~**A refused session is not recorded, though the notice says it is.**~~ **Fixed 2026-09-22 (D23):** the loop holds a
|
||||
refused session open until the target exits, so Tier 2 has a producer and the sentence is true for every refusal.
|
||||
- **A released Overlay logs its build as `v0.1.0-beta.3-dirty`**: the CI checkout is dirty by the time CMake runs
|
||||
- ~~**A released Overlay logs its build as `v0.1.0-beta.3-dirty`**: the CI checkout is dirty by the time CMake runs
|
||||
`git describe`. Both sides of the handshake compile the same string, so nothing breaks; it is a release that calls
|
||||
itself dirty.
|
||||
itself dirty.~~ **Fixed 2026-10-07 (beta.18 PR-3):** the dirt was `release.yml`'s own date substitution in
|
||||
`legal/*.md`; the workflow reads describe from the clean checkout before it and hands it to CMake as `FL_BUILD_ID`,
|
||||
and `tools/buildid-check.ps1` reads it back out of the published binaries (`12_BUILD` §Release-time token substitution).
|
||||
- ~~**An install over a running Agent half-replaces the folder** (three failed starts, `Microsoft.Data.Sqlite` not
|
||||
found).~~ **A GUESS, WITHDRAWN the same evening, and it had already been published in beta.4's notes.** Nothing was
|
||||
installed between the failures (20:59–21:01) and the start that worked (21:02); the PC had been restarted at 20:57
|
||||
@@ -2011,7 +2013,7 @@ during finalize, PR-4 the scan set's creation times (D51), PR-5 the App's viewer
|
||||
|
||||
**Owner-only, added to the list below:** item 12.
|
||||
|
||||
## **START HERE** — 2026-10-06, 0.1.0-beta.16: beta.15 verified, and the chip it left
|
||||
## ~~**START HERE**~~ — 2026-10-06, 0.1.0-beta.16: beta.15 verified, and the chip it left *(struck 2026-10-07: the head is §beta.17 below)*
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.16]`; this is what no other file carries. The owner, after beta.15's release
|
||||
(2026-10-06): owner-only item 12 passed on real hardware ("đã chạy và ok"), do the chip beta.15 left, release, and close
|
||||
@@ -2039,6 +2041,88 @@ added.*
|
||||
- **The desktop app forbids polling CI** (no `gh` loop, Monitor or ScheduleWakeup): it wakes the session on a failure, a
|
||||
conflict or a review comment, never on green, so a green PR waits for the owner's word or the owner's auto-merge.
|
||||
|
||||
## ~~**START HERE**~~ — 2026-10-07, 0.1.0-beta.17: text that follows a theme switch, scroll bars hidden everywhere, a wiki *(struck 2026-10-07: the head is §beta.18 below)*
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.17]`; this is what no other file carries. The owner's report (2026-10-07, three
|
||||
screenshots of beta.16): Settings' descriptions kept the old theme's colour after a switch; the Dashboard kept its
|
||||
scroll bar with Hide scroll bars on; "a complete wiki, concise and easy, End-user and Dev". Five stacked PRs — #281 the
|
||||
theme text, #282 the scroll bars, #283 the guide's four new pages, #284 the wiki and its publishing, then the
|
||||
release.*
|
||||
|
||||
**Decisions (owner, 2026-10-07, asked before the plan — do not re-ask):**
|
||||
|
||||
- **D53 — the wiki's source is the repository.** `wiki/` (Home, the sidebar, the developer pages) and `guide/` with
|
||||
`LIMITATIONS.md` are assembled by `tools/wiki-build.ps1` and published to the Wiki tab by `.github/workflows/wiki.yml`
|
||||
after a successful Release run (and by hand); a page edited on the tab is overwritten at the next release. English.
|
||||
- **D54 — the wiki's End-user half is the user guide**, one source: it grows past D44's eight pages (the screens, every
|
||||
setting, troubleshooting, a glossary — twelve) and stays embedded in the App. Tests hold that every setting the
|
||||
Settings page shows and every page and menu item of the main window is named in it.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **`ui:TextBlock Appearance` pins a brush.** WPF UI 4.3.0 resolves it once (`TryFindResource`) and coerces Foreground
|
||||
to it, so a theme switch leaves the text in the old theme; 129 texts used it. Every contrast check before measured a
|
||||
theme as a surface was *made* under it — a switch needs the surface hosted in a `Window`, because only
|
||||
`Application.Windows` hear a dictionary change (`16_WPFUI_SYNTAX` §Gotchas, `14_TESTING`).
|
||||
- **A class handler on `Loaded` is not a load hook.** WPF raises Loaded only where a subtree listens for it with its own
|
||||
handler, style EventSetter or template trigger — WPF UI's toggle switches carry one, which is why Settings hid its
|
||||
bar and the Dashboard never did. A test that calls `RaiseEvent(Loaded)` proves the handler, never that WPF reaches it;
|
||||
`ScrollChanged` reaches every scroller from its first layout.
|
||||
- **The wiki's git branch is `master`, and the repository's default workflow token is read-only:** `wiki.yml` declares
|
||||
`contents: write`. A release made with `GITHUB_TOKEN` fires no `release` event for another workflow; `workflow_run`
|
||||
does, and runs `main`'s copy of the file — so it checks out the run's `head_sha` and links at its tag.
|
||||
- **A fresh worktree cannot run the full gate** (the native configure, `CONTRIBUTING`): the stack's tip was gated in the
|
||||
main checkout on a detached HEAD, and each PR's own CI ran on its branch.
|
||||
- **Found while writing the guide, not fixed** (a task each): two notices can print an internal name — *"The hook
|
||||
stopped (WriterSelfDisabled)…"*, and a refusal no anti-cheat names reads ~~*"The anti-cheat guard did not hook this
|
||||
game: reason RefusedKillSwitch."*~~ *"…: reason RefusedByGuard."* *(corrected 2026-10-07 by beta.18's tests, which
|
||||
build the Agent's own events: the kill switch's refusal carries the gate's label where a family goes, and read "kill
|
||||
switch was detected in this game (… (FR-2.4) …)"; a re-scan that could not look read "Access is denied. was detected")*; the kill switch's *Applied* strip says "at the next session start" (it applies
|
||||
within 30 s); *Turn off* failing says "Nothing was enabled."; in the viewer, the exception switch, the Recording numbers and the Channel stay enabled;
|
||||
`08_UI` lists a "PawnIO missing" banner that does not exist; and a release's Overlay build id reads `-dirty` (§0.1.0-beta.4,
|
||||
"Found and NOT fixed", still open). *(All but the build id fixed by beta.18 PR-2, 2026-10-07; the build id is PR-3's.)*
|
||||
|
||||
**Owner-only, added to the list below:** item 13.
|
||||
|
||||
## **START HERE** — 2026-10-07, 0.1.0-beta.18: page titles readable in the dark theme, notices in words, a clean build id
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.18]`; this is what no other file carries. The owner's report (2026-10-07, five
|
||||
screenshots of beta.17 in the dark theme): every page's title and section headings near-black on the dark window — and
|
||||
the two chips beta.17 left (§beta.17, "Found while writing the guide"). Three stacked PRs — #286 the page text, #287
|
||||
the notices and the rest of that list, #288 the release build id — then the release.*
|
||||
|
||||
**No new decisions.** The train is the owner's request of 2026-10-07 ("beta18 with the two chip tasks, and the text that
|
||||
blends into the background in dark mode").
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **A page in the `NavigationView` inherits nothing.** `NavigationViewContentPresenter` is a `Frame`, and a Frame sets
|
||||
`InheritanceBehavior.SkipToAppNow`; WPF UI 4.3.0 makes the TextBlock default black. A page on screen during a theme
|
||||
switch takes the window's new colour through the switch and a page navigated to afterwards does not, so it came and
|
||||
went. Every check before hosted pages straight in a window and measured a page the App never draws — host a page in the
|
||||
presenter (`PagesLoadTests.Hosted`, `16_WPFUI_SYNTAX` §Gotchas).
|
||||
- **The accent is not in the theme dictionary.** WPF UI writes it into `Application.Resources` at every
|
||||
`ApplicationThemeManager.Apply(…, updateAccent: true)`; a test that swaps only the dictionary measures the other theme's
|
||||
accent (`Visuals.UnderTheme` derives it as the App does; `systemAccentColor: true` reads the machine's own palette).
|
||||
- **The gate's own refusals look like findings on the wire.** `HookedCaptureGate` puts a label ("kill switch", "previously
|
||||
blocked") where a family goes; whatever reads a family as "an anti-cheat was found" asks the end reason first. A test
|
||||
of what the user reads builds the event as the Agent does (`NoticesFromTheAgentTests`), never by hand — the
|
||||
hand-written events were why every notice test was green.
|
||||
- **`Safety_Consent_*` strings are versioned with the consent disclosure** (`SafetyDisclosure`): a message that is wrong
|
||||
on one path gets a key of its own rather than a changed meaning.
|
||||
- **A release's natives were `-dirty` by the release's own hand:** its date substitution edits `legal/*.md` before CMake
|
||||
reads describe. The id is read first, handed in, and read back out of the binaries (`tools/buildid-check.ps1`).
|
||||
- **Met again:** `CaptureHostEndToEndTests.WhenTheTargetExitsTheHostStopsAndSaysWhy` (`TargetNotRunning` on a slow
|
||||
runner) failed #286's first CI run; the job was re-run. **And a new one** failed #288's:
|
||||
`…LaunchModeOnAVulkanTargetAttachesToTheLayersRingAndInjectsNothing`. A hosted runner has the Vulkan loader and no
|
||||
device, so the harness exits 77 with a `[SKIP]` line — but the runner is elevated, the launch goes through
|
||||
`CreateProcessWithTokenW` (`UnelevatedProcess`), the child inherits no stdout, and the line never reaches the host's
|
||||
output; when the guard's scan hits the exiting harness (`ModuleScanFailed`) the test fails instead of skipping. Re-run;
|
||||
~~the deterministic fix is a task of its own~~ fixed the same day by beta.18 PR-5 (the test asks the harness itself,
|
||||
before the host runs), which also gave the `TargetNotRunning` case a 15 s hold (`13_CI_CD` §ci.yml).
|
||||
|
||||
**Owner-only, added to the list below:** item 14.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
|
||||
@@ -2126,6 +2210,21 @@ added.*
|
||||
(`12_BUILD` §Debugging) and start `FrameLedger.exe --data-dir <copy>`; the banner names the folder, the pill reads
|
||||
*Viewer — no Agent*, the switches are off, and the installed App runs beside it untouched. (f) The `ja` strings
|
||||
marked `review`.
|
||||
13. **beta.17 on real hardware.** (a) **A theme switch:** on Settings, Dark → Light → Dark, and again with a session's
|
||||
summary window open — every description and caption follows at once. (b) **Hide scroll bars** on: the Dashboard,
|
||||
Games, a game's page, Logs, About, Help ▸ User guide and a drop-down list draw no bar, and the wheel still scrolls;
|
||||
off, the bars come back without a restart. (c) **Help ▸ User guide** lists twelve pages and Limitations; a link to a
|
||||
section opens that section. (d) **The wiki**, once the release is out: the Wiki tab shows Home, the sidebar's two
|
||||
halves and a footer naming `v0.1.0-beta.17` — then tick *Restrict editing to collaborators only* (Settings ▸ General
|
||||
▸ Features ▸ Wikis), or anyone can change a page until the next release overwrites it. (e) The `ja` strings marked
|
||||
`review`.
|
||||
14. ~~**beta.18 on real hardware.**~~ **Passed 2026-10-08** — the owner ran it on real hardware and reported it OK ("Đã
|
||||
test và ok"). *(The item as written:)* (a) **The dark theme:** every page's title and section headings — Dashboard, Games, a
|
||||
game's page, Compare, Settings, Logs — read light on the dark window, after starting in Dark, after Light → Dark, and
|
||||
after moving between pages. (b) **The overlay build** on the Dashboard's *Capture agent* card reads `v0.1.0-beta.18`,
|
||||
without `-dirty`. (c) **Disable all hooking:** turning it on says a game being measured stops within 30 seconds; with
|
||||
it on, a hooked game's notice reads "All hooking is switched off in Settings, so nothing was measured." (d) The `ja`
|
||||
strings marked `review`, `Safety_Unhooked_Unnamed_Format` among them.
|
||||
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
|
||||
+5
-2
@@ -7,7 +7,8 @@ This folder is for people who build, change or review FrameLedger. **If you only
|
||||
|
||||
| You want to… | Read |
|
||||
|---|---|
|
||||
| Pick up work where it stopped | [`HANDOFF.md`](HANDOFF.md) — sequencing, decisions (D1…D46) and the traps that each cost a cycle. It carries no status on purpose |
|
||||
| Pick up work where it stopped | [`HANDOFF.md`](HANDOFF.md) — sequencing, decisions (~~D1…D46~~ D1 onward — *corrected 2026-10-07: the range grows with every train*) and the traps that each cost a cycle. It carries no status on purpose |
|
||||
| Find your way around first | The [wiki](https://github.com/poli0981/frameledger/wiki)'s developer pages (source: [`../wiki/`](../wiki/), beta.17) — a short page per part, each linking here |
|
||||
| Learn the system | [`../CLAUDE.md`](../CLAUDE.md) (the rules and the layout), then the reading order below |
|
||||
| Build it | [`12_BUILD.md`](12_BUILD.md) — `./build.ps1 check` is the whole gate, the same one CI runs |
|
||||
| Contribute or fork | [`../CONTRIBUTING.md`](../CONTRIBUTING.md), [`../FORKING.md`](../FORKING.md), [`../NOTICE`](../NOTICE) |
|
||||
@@ -76,7 +77,9 @@ are safety items, and something listed there as unresolved should not be built t
|
||||
|
||||
## Beside this folder
|
||||
|
||||
- [`../guide/`](../guide/README.md) — the user guide (players, English).
|
||||
- [`../guide/`](../guide/README.md) — the user guide (players, English); since beta.17 (D54) also the wiki's End-user part.
|
||||
- [`../wiki/`](../wiki/Home.md) — the wiki's own pages: Home, the sidebar, the developer pages (D53). `wiki.yml`
|
||||
publishes them with the guide to the Wiki tab when a release is made; `build.ps1`'s `wiki-check` holds every link.
|
||||
- [`../legal/`](../legal/) — the documents a user accepts, the accuracy statement, the third-party notices and licence
|
||||
texts, the trademark note.
|
||||
- [`../LIMITATIONS.md`](../LIMITATIONS.md) — what the whole software cannot do, in a player's words.
|
||||
|
||||
@@ -63,6 +63,15 @@ are kept because they record what each version changed and why (owner decision D
|
||||
>
|
||||
> Version 2.5 (2026-09-27, 0.1.0-beta.10) adds how a tracked game's window is shown — read from Windows — and the engine build name read from an Unreal Engine game's executable. It is also the first version to say two things the software already did: it reads the **content** of a library game's executable (markers in its first 8 MB and its import table, since the detection of engines and features; and, when a session starts, the graphics-library markers in the whole file), and it reads the processor load and the memory in use (since 0.1.0-beta.3). Nothing here leaves your device, as before.
|
||||
|
||||
### What version 2.8 of the Privacy Policy changed (0.1.0-beta.19)
|
||||
|
||||
§4 names the version marks an engine keeps in its own files, read to show a Unity, Godot or RPG Maker game's engine
|
||||
version (beta.19 PR-3, owner request 2026-10-12): Unity's player library (its version information) and the header of its
|
||||
data file, the header of a Godot data pack, an RPG Maker game's core script and `Game.ini` and the library `Game.ini`
|
||||
names. Two of them were read before and never stated: the version information of `UnityPlayer.dll` (the Unity rule's
|
||||
extractor since the detection rules began) and an RPG Maker MV/MZ game's title in `data/System.json`, which the App reads
|
||||
to name a game added by hand (since 2026-09-23). Nothing here leaves your device, as before.
|
||||
|
||||
### What version 2.7 of the Privacy Policy changed (0.1.0-beta.14)
|
||||
|
||||
§4 says two things the software reads to tell a crash from an ordinary exit: the crash reports Windows keeps in its
|
||||
|
||||
@@ -2633,3 +2633,34 @@ from this PR's build):**
|
||||
refused, and the private working set then reads N/A), AMD and Intel GPUs, a laptop with two adapters (the reader sums
|
||||
every adapter's instances for the pid), and a real game — the owner's beta.12 check (HANDOFF owner-only item 9) compares
|
||||
a session's figures with Task Manager's Details tab at the same moment.
|
||||
|
||||
## 17 · Unity, Godot and RPG Maker versions in installed games *(2026-10-12, beta.19)*
|
||||
|
||||
Measured read-only on the owner's machine (i7-14700KF, RTX 5080, Windows 11 29648) before the readers were written:
|
||||
every `UnityPlayer.dll`, `*.pck`, `rmmz_core.js`, `rpg_core.js` and `RGSS*.dll` up to five levels under `D:\another`
|
||||
(GOG, itch and loose installs), `D:\SteamLibrary\steamapps\common`, Steam's own `common` and `G:\` — 23 installs, read in
|
||||
9.6 s. Then again through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`, rules `2026.10.2`), which read
|
||||
every install as tabled. Nothing was copied or written; the decision rules are in `05_DETECTION` §Engine version — Unity,
|
||||
Godot, RPG Maker.
|
||||
|
||||
| Engine | Installs | What the files say | Read as (shipped) | Detect time |
|
||||
|---|---|---|---|---|
|
||||
| Unity 2020+ | DONT GO, Dialoop, Broken Shell Demo, Deadly Heart Gambit, DreadFields, Kemono Teatime, March Out!, Umamusume, Walto, Yasha, Yu-Gi-Oh! Master Duel, 帰路, Legends of Runeterra | `UnityPlayer.dll` ProductVersion `2022.3.39f1 (4e1b0f82c39a)` … `6000.3.17f1 (cf0352b38e81)`; FileVersion `2022.3.39.5118735` (the build number where the release letter belongs) | the ProductVersion's editor version (`unity_player`) | 26 ms – 4.1 s |
|
||||
| Unity 2019.4 | A Space for the Unbound - Prologue (GOG) | ProductVersion = FileVersion `2019.4.1.15122501`; `*_Data/globalgamemanagers` byte 20: `2019.4.1f1` | `2019.4.1f1` (`unity_data`) | 102 ms |
|
||||
| Unity 2019.4 | GIRLS' FRONTLINE 2: EXILIUM | ProductVersion `2019.4.40.16762411`; the data file's header is not readable (encrypted) | `2019.4.40` (`unity_player_file`) | 2.2 s |
|
||||
| Godot 4 | Plethora of Bullets 2 (itch), 衔蝶 (Steam) | `<exe>.pck` header `GDPC`, format 2, `4.2.2` / `4.4.1`; the exe's `Godot Engine v4.4.1.stable.official` sits 57–78 MB in; 衔蝶's version resource is the studio's (`0.1.0.3`) | `4.2.2`, `4.4.1` (`godot_pck`) | 24–41 ms |
|
||||
| RPG Maker MZ | A Doll's Locket - Remake (itch) | `js/rmmz_core.js` line 2 `// rmmz_core.js v1.10.0` (also under the runtime's `css\js\`) | MZ `1.10.0` | 41–53 ms |
|
||||
| RPG Maker MV | Flower in Us (Steam), 996IR, HELLO, HELLO WORLD! (itch) | `www/js/rpg_core.js` `v1.6.2`, `v1.6.2`, `v1.6.1` (HHW's one folder above its runtime) | MV `1.6.x` | 70–275 ms |
|
||||
| RPG Maker VX Ace | City of Bones, Träumerei Chapter 2 (itch) | `Game.ini`: `Library=System\RGSS301.dll`; the DLL's version `3, 0, 1, 1` | VX Ace, RGSS `3.0.1` | 427–442 ms |
|
||||
|
||||
- **Detect time** is the whole detection of one entry — the install's walk, the rules and the second read — on the USB
|
||||
drive; the second read itself is a version resource and at most a few kilobytes. It runs once per executable and rules
|
||||
version, like Unreal's.
|
||||
- **Four of the itch installs front their runtime with a 213 MB .NET launcher** (HELLO, HELLO WORLD!, A Doll's Locket -
|
||||
Remake — whose launcher asks for administrator —, City of Bones and Träumerei) — the reason the import's choice of
|
||||
executable changed in the same train (`05_DETECTION` §Library import, D56).
|
||||
- **Not measured:** RPG Maker 2000/2003 (`RPG_RT.exe`; none installed, and no rule detects it), XP and VX (no install —
|
||||
their RGSS1/RGSS2 libraries are read by the same rule as VX Ace's, unmeasured), a Unity build older than 2019 (its
|
||||
player is the executable, with no `UnityPlayer.dll`), a Godot 3 export, and a Godot pack appended to the executable
|
||||
(both installs ship the pack beside it; the trailer the reader follows is Godot's documented layout, tested on
|
||||
synthetic files only).
|
||||
@@ -0,0 +1,122 @@
|
||||
# The screens
|
||||
|
||||
What each part of FrameLedger shows and what each button does. What the numbers mean is in
|
||||
[Read your results](03-read-your-results.md); every setting is in [Every setting](08-settings.md).
|
||||
|
||||
## The main window
|
||||
|
||||
**The badge at the top right** says how the capture agent is doing:
|
||||
|
||||
| Badge | Meaning |
|
||||
|---|---|
|
||||
| Agent connected | Everything works. |
|
||||
| Connecting to agent… · Starting agent… | FrameLedger is reaching the agent, or starting it. Give it a few seconds. |
|
||||
| Waiting for administrator permission… | *Run the agent as administrator* is on, and Windows is asking you. |
|
||||
| Agent offline | The agent is installed but does not answer. FrameLedger keeps trying; **Retry** on the banner tries now. |
|
||||
| Agent not installed | `FrameLedger.Agent.exe` is missing: install FrameLedger again. |
|
||||
| Viewer — no Agent | You opened a copy of a data folder to look at ([When something goes wrong](09-troubleshooting.md#looking-at-a-copy-of-your-data)). |
|
||||
|
||||
**Banners** under the menus stay until you act on them: *Capture agent offline* with **Retry**; *Update* with **Restart to
|
||||
update** (it waits while a game is being recorded); and the safety notices — a game's hooking refused, measurement
|
||||
stopped, hooking turned off — each with one button that only says you have read it.
|
||||
|
||||
**The pages** are on the left: **Dashboard**, **Games**, **Compare**, **Logs**, and **Settings** at the bottom.
|
||||
|
||||
## The menus
|
||||
|
||||
| Menu | Item | What it does |
|
||||
|---|---|---|
|
||||
| **File** | **Add game…** | Pick a game's `.exe` file. It is added with hooking off, and its page opens. |
|
||||
| | **Import library…** | A checklist of the games installed through Steam, GOG Galaxy, Epic and itch.io. |
|
||||
| | **Export** ▸ **Session CSV** · **Session JSON** · **Chart PNG** | Saves the session you last selected or opened. Read [Your data](05-your-data.md) before you share a file. |
|
||||
| | **Exit** | Quits FrameLedger, even when *Minimize to tray on close* is on. |
|
||||
| **Tools** | **Agent status…** | Opens the Dashboard, where the agent's card is. |
|
||||
| | **Update detection rules** | The agent reads its detection rules again and checks your games again. |
|
||||
| | **Vulkan layer registration…** | Opens Settings, where the Vulkan layer is. |
|
||||
| | **Open data folder** | Opens `%LOCALAPPDATA%\FrameLedger` in Explorer. |
|
||||
| | **Database maintenance…** | **Check**, **Back up…**, **Sweep…** and **Compact** your database ([When something goes wrong](09-troubleshooting.md#the-database)). |
|
||||
| **Help** | **User guide** | This guide. |
|
||||
| | **Check for updates** | Asks GitHub now. |
|
||||
| | **Report a bug…** | Builds a report on your PC ([When something goes wrong](09-troubleshooting.md#report-a-problem)). |
|
||||
| | **Online documentation** | The project's page on GitHub. |
|
||||
| | **Limitations** | What FrameLedger cannot do. |
|
||||
| | **About FrameLedger** | The version, the licences and the notices. |
|
||||
|
||||
## Dashboard
|
||||
|
||||
- **Live capture** — the game being recorded right now: its name, **T1** (measured) or **T2** (recorded only), and the
|
||||
time so far. While it is measured: the frame rate, the resolution, the upscaler, frame generation, ray tracing, the GPU
|
||||
and CPU temperatures and the game's memory. *Attached — waiting for the first frames…* means hooking worked and the
|
||||
first frames are on their way.
|
||||
- **Games tracked**, **Total playtime**, **Sessions this week**.
|
||||
- **Capture agent** — *State*, *Agent version*, *Telemetry source* (which sensor readers work on this PC: `l1` is
|
||||
Windows itself, `lhm` is LibreHardwareMonitor, `nvapi` is NVIDIA's own and only on NVIDIA cards), *Overlay build* (the
|
||||
version of the component loaded into games), *Elevated* (whether the agent runs as administrator) and *Running
|
||||
sessions*. Everything reads N/A until the agent answers.
|
||||
- **Recent sessions** — the ten newest. Click one to open its summary.
|
||||
|
||||
## Games
|
||||
|
||||
- **Search games**; sort by **Name**, **Last played** or **Playtime**; **Show as a list** or **Show as a grid**.
|
||||
- **Refresh** reads your library again: it offers games newly installed through a store, and marks a game whose `.exe`
|
||||
is gone as *Not installed*.
|
||||
- **Add game…** — or drop `.exe` files onto the page.
|
||||
- Each game shows its name, its store and engine, and one state: **Hooking on**, **Hooking off**, **Anti-cheat** (found,
|
||||
so it is not hooked), **Exception** (a user-mode exception is in force) or **Not recorded**; then its sessions,
|
||||
playtime and last play. Click it to open its page (in the list: double-click, or Enter).
|
||||
|
||||
## A game's page
|
||||
|
||||
- **At the top:** the name, publisher, version, store and engine, the `.exe` path, the last session, the last measured
|
||||
session's frame rate and its ray-tracing chips. **Edit…** changes the name, publisher, version and notes. **Change
|
||||
executable…** points the entry at another `.exe` and turns hooking back off; its file dialog opens in the game's own
|
||||
folder. **Remove…** asks whether to keep the game's sessions.
|
||||
- **Recording** — off, FrameLedger ignores the program completely: for a launcher or a tool that is not a game.
|
||||
- **Hooking** — on, the game is measured. A warning comes first, and you type `I ACCEPT THE INJECTION RISK` to go on.
|
||||
Read [Anti-cheat and safety](04-anti-cheat-and-safety.md) before you do.
|
||||
- **Anti-cheat** — shown in its place when anti-cheat was found: what was found, and where. **User-mode exception**
|
||||
appears when the game qualifies for the one exception.
|
||||
- **Supports** and **Details** — what the game's own files contain, as far as FrameLedger can tell.
|
||||
- **Tabs:** **Sessions** (every session: double-click a row or press **Open**; **Delete all sessions…** at the top),
|
||||
**Frametime**, **Distribution**, **Trend** (one point per session for a figure you choose, with changes to your
|
||||
hardware or driver marked), **Sensors**, and **Latency** when the game reported it.
|
||||
|
||||
## A session's summary
|
||||
|
||||
It opens from a session row, from the Dashboard, and from the notice when a session is saved.
|
||||
|
||||
- A warning at the top when the game crashed or measuring stopped early.
|
||||
- The **Ray Tracing**, **Path Tracing** and **Ray Reconstruction** chips: click one to correct it by hand, for this
|
||||
session or as the game's default. Your correction is labelled as yours.
|
||||
- The figures, the charts and **Statistics per series** — [Read your results](03-read-your-results.md) explains each.
|
||||
- **Tags and notes** with **Save**, and **Export CSV**, **Export JSON**, **Export PNG**.
|
||||
|
||||
## Compare
|
||||
|
||||
Tick **2 to 5 sessions**, from any of your games, and press **Compare**: one frame-rate curve per measured session, and
|
||||
a table with the best value of each row in bold. Comparing a measured session with an unmeasured one asks first,
|
||||
because they measured different things.
|
||||
|
||||
## Logs
|
||||
|
||||
What FrameLedger and its agent wrote down. Choose **App** or **Agent**, a level, and search; **Pause** stops the view from
|
||||
following new lines. **Open logs folder**, and **Export bug bundle**, which does the same as Help ▸ Report a bug….
|
||||
|
||||
## Settings
|
||||
|
||||
Every switch and box is described in [Every setting](08-settings.md).
|
||||
|
||||
## The tray icon
|
||||
|
||||
The icon by the clock has **Open FrameLedger**, **Pause capture** / **Resume capture**, **Agent status** and **Exit**; a
|
||||
click on it opens the window. **Pause capture** stops measuring the running sessions until you resume, and the paused
|
||||
stretch is left out of their figures. While the window is hidden, a notice pops up when a session is saved or an update
|
||||
is ready.
|
||||
|
||||
## Keyboard and mouse
|
||||
|
||||
- **Ctrl+1** … **Ctrl+5** open Dashboard, Games, Compare, Logs and Settings.
|
||||
- **Alt** or **F10** moves to the menus.
|
||||
- **Esc** closes a dialog the way its Close or Cancel button does.
|
||||
- Over a chart, **Ctrl** and the mouse wheel zoom, dragging pans, and a double-click resets. The wheel alone scrolls the
|
||||
page.
|
||||
@@ -0,0 +1,75 @@
|
||||
# Every setting
|
||||
|
||||
Settings is the last item on the left. Its sections follow, in the order it shows them. Settings marked *agent* are read
|
||||
by the capture agent; unless the row says otherwise, a change applies from the next session.
|
||||
|
||||
## Capture
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Disable all hooking** | Nothing is loaded into any game, whatever each game's own switch says. A game being measured stops being measured at the next safety check, within 30 seconds. Sessions are still recorded. *Agent.* | Off |
|
||||
| **Games with hooking on** | Shown while any game has hooking on: one **Turn off** per game. | — |
|
||||
| **Hide hooking on anti-cheat games** | On, the page of a game where anti-cheat was found shows only what was found; off, it also shows the Hooking switch, greyed out. Such a game is never hooked either way. | On |
|
||||
| **Allow hooking in games whose only anti-cheat runs in user mode** | Turns on the one narrow exception ([Anti-cheat and safety](04-anti-cheat-and-safety.md#the-one-exception-you-can-make)). The games that qualify are listed under it, each with **Make exception…** (after a warning) or **Withdraw**. *Agent.* | Off |
|
||||
| **Vulkan layer** | The component that measures Vulkan games — but only a game FrameLedger starts itself, which the App cannot do yet, so a Vulkan game you start is recorded, not measured. The agent registers and removes it by itself; **Register** and **Unregister** repair that, for your Windows user only. | — |
|
||||
|
||||
The link under them, *Read what the hook does and does not do*, opens the safety document on GitHub.
|
||||
|
||||
## Recording
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Minimum session length (s)** | A shorter session is not kept. 5 to 600 seconds. *Agent.* | 30 |
|
||||
| **Sensor interval (ms)** | How often the PC's sensors are read during a session. 500 to 2000 ms. *Agent.* | 1000 |
|
||||
| **Raw series kept per game** | How many of each game's newest sessions keep their per-frame data; older ones keep their statistics. 0 keeps everything. *Agent.* | 20 |
|
||||
|
||||
## Data
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Delete all sessions** | Deletes every session of every game, with its data and notes, after asking. Your library, your settings and each game's hooking choice stay. It cannot be undone, and it is refused while a game is being recorded. | — |
|
||||
|
||||
## Capture agent
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Run the agent as administrator** | Lets FrameLedger measure games that run as administrator, and read CPU temperature with PawnIO installed. Windows asks every time the agent starts, at logon too. A warning explains the risk first; read [Limitations](../LIMITATIONS.md#running-the-agent-as-administrator). The agent restarts to apply it, or at its next start if a game is being recorded. | Off |
|
||||
| **Start the agent at logon** | **Register**, **Repair** or **Remove** a task that starts the agent when you log on, for your user only and without administrator rights. Without it, FrameLedger starts the agent when you open it. | Not installed |
|
||||
|
||||
## Appearance
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Theme** | Follow system, Light or Dark. Applies at once. | Follow system |
|
||||
| **Language** | English, Tiếng Việt or 日本語. The window is rebuilt in the new language at once. | English |
|
||||
|
||||
## Window
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Start FrameLedger with Windows** | Opens FrameLedger when you log on, for your user only. | Off |
|
||||
| **Minimize to tray on close** | Closing the window keeps FrameLedger running by the clock; quit with **Exit** in the tray's menu or the File menu. | Off |
|
||||
| **Show FPS with two decimals** | Every frame rate with two decimals (62.40) instead of a whole number (62). Pages show it when they next open. | Off |
|
||||
| **Hide scroll bars** | No scroll bars are drawn anywhere; the wheel, the keyboard and touch still scroll. Applies at once. | Off |
|
||||
|
||||
## Updates
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Channel** | *Automatic* follows your copy: a test version (a pre-release) looks for test versions, a release for releases. Or choose *Stable*, or *Beta* (releases and pre-releases). | Automatic |
|
||||
| **Check for updates at startup** | One question to GitHub a few seconds after FrameLedger starts. A new version downloads in the background and installs only when you restart. | On |
|
||||
|
||||
## Logging
|
||||
|
||||
| Setting | What it does | Default |
|
||||
|---|---|---|
|
||||
| **Debug logging** | FrameLedger writes far more detail into its log, for a bug report. The agent keeps its own level. | Off |
|
||||
|
||||
## System
|
||||
|
||||
This PC as FrameLedger records it with every session: processor, graphics card and driver, memory, Windows build and
|
||||
the main display. Nothing is sent anywhere. **Copy** puts the lines on the clipboard, for a bug report.
|
||||
|
||||
## Legal
|
||||
|
||||
**Reopen the legal documents** shows the documents you accepted, and the GPL, again. Nothing is accepted again.
|
||||
@@ -0,0 +1,98 @@
|
||||
# When something goes wrong
|
||||
|
||||
Find what you see, then what it means and what to do. Questions that are not problems are in
|
||||
[Questions and answers](06-faq.md).
|
||||
|
||||
## The capture agent is not working
|
||||
|
||||
| You see | It means | Do this |
|
||||
|---|---|---|
|
||||
| **Connecting to agent…** or **Starting agent…** | FrameLedger is reaching its agent, or starting it. | Wait a few seconds. |
|
||||
| **Agent offline**, and a banner: *The capture agent is not answering* | The agent is installed but does not answer. Your library, sessions and charts still work; only what is live does not. FrameLedger keeps trying. | **Retry** on the banner, or close FrameLedger and open it again. |
|
||||
| **Agent not installed** | `FrameLedger.Agent.exe` is missing from FrameLedger's folder. | Install FrameLedger again from the [Releases page](https://github.com/poli0981/frameledger/releases). |
|
||||
| **Waiting for administrator permission…** | *Run the agent as administrator* is on, and Windows is asking. The prompt may be waiting on the taskbar. | Answer it — or switch the option off in Settings ▸ Capture agent. |
|
||||
| Settings says *the administrator prompt was declined* | The agent runs with your normal rights. | Nothing, unless you need it ([Every setting](08-settings.md#capture-agent)). |
|
||||
|
||||
## A game was recorded but not measured
|
||||
|
||||
The session is **T2**, its frame figures read N/A, and its summary says why on the **Why:** line — go by that line.
|
||||
While the game runs, a notice may say *hooking refused*.
|
||||
|
||||
| Why | Do this |
|
||||
|---|---|
|
||||
| Hooking was off for the game. | Switch **Hooking** on in the game's page, after reading [Anti-cheat and safety](04-anti-cheat-and-safety.md). |
|
||||
| The game's file changed since hooking was switched on — an update, usually. | Switch hooking on again for it. |
|
||||
| The game you added is its launcher. | Add the game's own `.exe` too: hooking a launcher does not reach the game it starts. |
|
||||
| Anti-cheat was found in the game. | Nothing: FrameLedger will not hook it, and hooking stays off. The only exception is narrow ([Anti-cheat and safety](04-anti-cheat-and-safety.md#the-one-exception-you-can-make)). |
|
||||
| An anti-cheat driver or service was running on the PC. It may belong to another game. | Close the program it belongs to: the next session is measured again. |
|
||||
| Anti-cheat appeared while the game was running. | Nothing: measuring stopped, and the summary says *Measurement stopped early*. |
|
||||
| FrameLedger could not check the game's files. | It checks again by itself; Tools ▸ Update detection rules checks now. |
|
||||
| The game runs as administrator. | Settings ▸ Capture agent ▸ *Run the agent as administrator* — read its risk in [Limitations](../LIMITATIONS.md#running-the-agent-as-administrator) first. A game protected by an anti-cheat driver cannot be measured either way. |
|
||||
| The game is 32-bit, uses DirectX 9, or uses Vulkan. | Nothing: these are recorded, not measured ([Limitations](../LIMITATIONS.md#games-it-will-not-measure)). |
|
||||
| **Disable all hooking** is on. | Switch it off in Settings ▸ Capture. |
|
||||
| The game was already running when FrameLedger was updated. | Close the game and start it again. |
|
||||
| Hooking was switched off after the game crashed twice soon after it started. | Switch it on again in the game's page if the cause may be gone — after a driver update, for example. |
|
||||
| The game's file is gone. | If only its drive letter changed, FrameLedger follows it within about 15 seconds; otherwise **Change executable…** on the game's page. |
|
||||
| The component could not be loaded into the game. | [Report a problem](#report-a-problem). |
|
||||
|
||||
## Some numbers read N/A
|
||||
|
||||
- **Everything** reads N/A: the session was not measured — see above.
|
||||
- **1% low** needs 1,000 of the game's own frames, and **0.1% low** 10,000: a shorter session reads N/A for them.
|
||||
- **VSync** reads N/A for OpenGL games.
|
||||
- **VRAM (this game)** reads N/A for the game's first second.
|
||||
- **GPU sensors** on AMD and Intel cards have not been tested, and **GPU held back** is read on NVIDIA cards only.
|
||||
- **A session's charts are gone**: its per-frame data was removed under *Raw series kept per game*
|
||||
([Every setting](08-settings.md#recording)); its statistics stay.
|
||||
- **Presented FPS** instead of the game's own frame rate, **video memory** that differs from an in-game overlay, and
|
||||
**CPU temperature**: see [Questions and answers](06-faq.md).
|
||||
|
||||
## A session says the game crashed
|
||||
|
||||
*How it ended*, on the session's summary:
|
||||
|
||||
| It says | It means |
|
||||
|---|---|
|
||||
| ended normally | The game closed by itself. |
|
||||
| ended with exit code 1 | What *End task* or `taskkill` leaves behind: not a crash. |
|
||||
| crashed (0xC0000005 …) | The game ended with an error code. *0xC0000006* often points at a failing drive. |
|
||||
| crashed (Windows logged an application error) | Windows recorded the game's crash. |
|
||||
| crashed (the game started its crash reporter, …) | The game's own crash reporter started while it was ending. |
|
||||
| interrupted | The agent itself stopped during the session; the session was rebuilt when the agent next started. |
|
||||
|
||||
More in [Limitations](../LIMITATIONS.md#when-a-game-crashed). If FrameLedger itself stops, it says *FrameLedger stopped
|
||||
unexpectedly* and offers to report it.
|
||||
|
||||
## An update does not install
|
||||
|
||||
- *A session is running, so it is applied only after the session ends* — restart FrameLedger once the game has closed.
|
||||
- *… is still loaded in a game FrameLedger measured* — close that game, then **Restart to update**.
|
||||
- *Try again in about an hour* — GitHub limits how often it is asked. *Offline* — no connection.
|
||||
- A download that fails its check twice: [report a problem](#report-a-problem).
|
||||
- Windows warns about the installer: see [Install and first start](01-install.md#download-and-install).
|
||||
|
||||
## The database
|
||||
|
||||
Everything is in one file, the ledger. **Tools ▸ Database maintenance…**:
|
||||
|
||||
- **Check** reads the whole file. If it finds a problem, **Back up…** first, then [report a problem](#report-a-problem).
|
||||
- **Back up…** writes a consistent copy wherever you choose, even while a game is recorded.
|
||||
- **Sweep…** removes old per-frame data, as *Raw series kept per game* does; it needs the agent running.
|
||||
- **Compact** gives freed space back to the disk; it waits until no game is being recorded.
|
||||
- *The ledger was busy* — try again in a moment.
|
||||
|
||||
## Looking at a copy of your data
|
||||
|
||||
`FrameLedger.exe --data-dir <folder>` opens a **copy** of a data folder to look at — one sent with a bug report, for
|
||||
example. The badge reads **Viewer — no Agent**: nothing is recorded and nothing on this PC is changed. It refuses your own
|
||||
data folder.
|
||||
|
||||
## Report a problem
|
||||
|
||||
- **Help ▸ Report a bug…** (or Logs ▸ Export bug bundle) saves a zip on your PC with FrameLedger's logs, a description of
|
||||
your PC and your settings — and, if you tick them, FrameLedger's last crash dump and the last session without its
|
||||
frames, notes or tags. Your Windows user name is removed from the paths in the logs; the crash dump is not cleaned.
|
||||
You see every file, then the issue form opens on GitHub, and you add the zip yourself: FrameLedger sends nothing.
|
||||
- The logs are in `%LOCALAPPDATA%\FrameLedger\logs` (Logs ▸ Open logs folder).
|
||||
- If FrameLedger missed a game's anti-cheat, use the **Safety gap** form instead
|
||||
([Anti-cheat and safety](04-anti-cheat-and-safety.md#if-frameledger-missed-a-games-anti-cheat)).
|
||||
@@ -0,0 +1,60 @@
|
||||
# Words FrameLedger uses
|
||||
|
||||
What the words on FrameLedger's screens mean, in alphabetical order. How each figure is computed is in the developers'
|
||||
[metrics document](../docs/03_METRICS.md).
|
||||
|
||||
- **0.1% low, 1% low** — the frame rate of the game's slowest 0.1% and 1% of frames. The further they fall below the
|
||||
average, the less smooth the game felt. They need 10,000 and 1,000 of the game's own frames.
|
||||
- **Agent** (the capture agent) — the program FrameLedger runs in the background, with your normal rights, that notices
|
||||
a game starting and records it.
|
||||
- **Anti-cheat finding** — what FrameLedger's anti-cheat check found for a game: a component loaded into it, a file or
|
||||
folder of it, or the game itself on a list. A game with a finding is not hooked ([Anti-cheat and
|
||||
safety](04-anti-cheat-and-safety.md)).
|
||||
- **Bug bundle** — the zip **Help ▸ Report a bug…** writes on your PC. Nothing is sent by FrameLedger.
|
||||
- **Compare** — two to five sessions side by side, from any of your games.
|
||||
- **Disable all hooking** — the switch that stops every game from being hooked at once, whatever each game's own switch
|
||||
says. Sessions are still recorded.
|
||||
- **Displayed FPS** — the frames you saw, generated frames included.
|
||||
- **FG factor** — Displayed FPS divided by Native FPS, shown as `×1.9 FG`.
|
||||
- **FPS** — frames per second over the time measured.
|
||||
- **Frame generation** — the technology (DLSS Frame Generation, FSR Frame Generation) that inserts frames the game did
|
||||
not render itself.
|
||||
- **Frame time** — how long one frame took, in milliseconds.
|
||||
- **Frame to frame** — how much one frame's time differs from the next. Lower is smoother.
|
||||
- **Frames per watt** — the game's own frames per second for each watt the graphics card drew.
|
||||
- **GPU held back** — how much of the time the card's power limit or its temperature slowed it down. NVIDIA cards only.
|
||||
- **Hooking** — loading FrameLedger's small component into a game to measure it. Off for every game until you switch
|
||||
it on for that game.
|
||||
- **Ledger** — the one database file that holds your library and sessions, `%LOCALAPPDATA%\FrameLedger\ledger.db`.
|
||||
- **N/A** — not measured. Never 0, and never an estimate.
|
||||
- **Native FPS** — the frames the game rendered itself.
|
||||
- **Overlay build** — the version of the component that hooking loads into a game. It draws nothing on your screen.
|
||||
- **Override** — your own Yes, No or N/A for a ray-tracing chip. The measured value is kept, and yours is marked as
|
||||
yours.
|
||||
- **Presented FPS** — every frame the game handed to Windows, shown when frame generation could not be measured, with a
|
||||
note saying whether generated frames could be among them.
|
||||
- **RAM (this game)** — the game's own memory, what Task Manager's Details tab shows as its private working set.
|
||||
- **Ray tracing, Path tracing, Ray reconstruction** — read *Yes*, *No* or *N/A*. Ray tracing is measured on DirectX 12
|
||||
games; path tracing is never stated as a fact.
|
||||
- **Render scale** — the share of the screen's resolution the game drew at before upscaling. 100% means no upscaling.
|
||||
- **Session** — one run of a game, from its start to its end. A session shorter than 30 seconds is not kept.
|
||||
- **Steady state** — when frame generation changed during a session (menus, loading screens, a settings change), the
|
||||
figures are for the state that lasted longest, with the share of the session it covers: `×1.9 FG · 75%`.
|
||||
- **Stutter** — frames that took more than twice as long as the frames around them, counted, with the share of time
|
||||
they took.
|
||||
- **T1** — a measured session. **T2** — a session that was only recorded: how long you played, your PC's sensors and
|
||||
the game's memory, with every frame figure N/A.
|
||||
- **Tags and notes** — what you write on a session's summary.
|
||||
- **Telemetry source** — which sensor readers work on this PC: `l1` is Windows itself, `lhm` is LibreHardwareMonitor,
|
||||
`nvapi` is NVIDIA's own.
|
||||
- **Time below 60 FPS** — how much of the session ran slower than 60 frames per second (and *below 30*, and *below your
|
||||
display's refresh rate*), not counting the tiny wobble of a game held at its frame limit.
|
||||
- **Trend** — one point per measured session over time, on a game's page.
|
||||
- **Upscaler** — the technology that draws the game at a lower resolution and scales it up (DLSS, FSR).
|
||||
- **User-mode exception** — the one way to hook a game where anti-cheat was found: only an anti-cheat that runs entirely
|
||||
inside the game, one game at a time, after a warning. Its first two sessions are a trial.
|
||||
- **Viewer** — FrameLedger opened over a copy of a data folder: no agent, nothing recorded, nothing changed.
|
||||
- **VRAM (this game)** — the game's own video memory, what Task Manager shows as its *Dedicated GPU memory*.
|
||||
- **VSync** — how many frames asked to wait for the display; *tearing allowed*, how many did not mind tearing. It is
|
||||
what the game asked: your graphics driver can override it.
|
||||
- **Vulkan layer** — the component that measures Vulkan games, used only when FrameLedger starts a game itself.
|
||||
+7
-3
@@ -4,7 +4,7 @@ FrameLedger records how your games run on this PC — frame rate, frame times, t
|
||||
with, temperatures, and how much memory the game uses — and keeps every session so you can compare them later.
|
||||
Everything stays on your PC.
|
||||
|
||||
Each page below takes a minute or two to read.
|
||||
Each page below takes a minute or two to read. The first six are the guide; the next four are there to look things up.
|
||||
|
||||
1. [Install and first start](01-install.md)
|
||||
2. [Record a game](02-record-a-game.md)
|
||||
@@ -12,7 +12,11 @@ Each page below takes a minute or two to read.
|
||||
4. [Anti-cheat and safety](04-anti-cheat-and-safety.md) — read this before you switch hooking on for any game
|
||||
5. [Your data](05-your-data.md)
|
||||
6. [Questions and answers](06-faq.md)
|
||||
7. [The terms, in plain words](terms-in-plain-words.md)
|
||||
7. [The screens](07-screens.md) — what each page, menu and button does
|
||||
8. [Every setting](08-settings.md)
|
||||
9. [When something goes wrong](09-troubleshooting.md)
|
||||
10. [Words FrameLedger uses](10-glossary.md)
|
||||
11. [The terms, in plain words](terms-in-plain-words.md)
|
||||
|
||||
What FrameLedger cannot do is listed on its own page: [Limitations](../LIMITATIONS.md) (in the app: Help ▸
|
||||
Limitations).
|
||||
@@ -21,4 +25,4 @@ Limitations).
|
||||
report on your PC that you can look at before you decide to share it.
|
||||
|
||||
This guide is part of FrameLedger and describes the version it came with. It is also in the project's repository on
|
||||
GitHub, in the `guide` folder.
|
||||
GitHub, in the `guide` folder, and on the project's wiki, which shows the newest release.
|
||||
+6
-3
@@ -12,7 +12,7 @@
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.16`** (2026-10-06), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.18`** (2026-10-07), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -63,8 +63,11 @@
|
||||
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
|
||||
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
|
||||
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
|
||||
> files state.
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
|
||||
> player library or its data file — without the release letter where only the library's number is readable),
|
||||
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
|
||||
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
|
||||
> engines show what their own files state.
|
||||
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
|
||||
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
|
||||
> once a second from Windows' own counters, from outside the game, in every session: a game
|
||||
|
||||
+6
-3
@@ -114,7 +114,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-06.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.16`** (2026-10-06), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.18`** (2026-10-07), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -165,8 +165,11 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> swap chain; for every other session the window alone is read, and a window covering its monitor reads
|
||||
> *full-screen or borderless*. What Windows does behind the game (fullscreen optimizations) is not visible.
|
||||
> - **Engine version:** the exact Unreal Engine 4 or 5 version, read from the game's executable on disk and
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Other engines show what their own
|
||||
> files state.
|
||||
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
|
||||
> player library or its data file — without the release letter where only the library's number is readable),
|
||||
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
|
||||
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
|
||||
> engines show what their own files state.
|
||||
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
|
||||
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
|
||||
> once a second from Windows' own counters, from outside the game, in every session: a game
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — Privacy Policy
|
||||
|
||||
**Version:** 2.7 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.8 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
|
||||
|
||||
@@ -39,7 +39,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
|
||||
|
||||
## 4. What the app can technically observe
|
||||
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, and the library Game.ini names), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
|
||||
|
||||
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"level, which made it a check that could not fire."
|
||||
],
|
||||
"schemaVersion": 2,
|
||||
"rulesVersion": "2026.10.1",
|
||||
"rulesVersion": "2026.10.2",
|
||||
|
||||
"engines": [
|
||||
{
|
||||
@@ -52,7 +52,7 @@
|
||||
{ "type": "sibling_glob", "value": "UnityPlayer.dll" },
|
||||
{ "type": "dir_exists", "value": "${ExeName}_Data" }
|
||||
] },
|
||||
"version": { "type": "pe_file_version", "from": "UnityPlayer.dll" }
|
||||
"version": { "type": "unity_build" }
|
||||
},
|
||||
{
|
||||
"id": "unreal",
|
||||
@@ -70,7 +70,7 @@
|
||||
{ "type": "sibling_glob", "value": "nw.dll" },
|
||||
{ "type": "sibling_glob", "value": "package.json" }
|
||||
] },
|
||||
"version": null
|
||||
"version": { "type": "rpgmaker_build" }
|
||||
},
|
||||
{
|
||||
"id": "rpgmaker_rgss",
|
||||
@@ -83,7 +83,7 @@
|
||||
{ "type": "sibling_glob", "value": "*.rgss2a" },
|
||||
{ "type": "sibling_glob", "value": "*.rgss3a" }
|
||||
] },
|
||||
"version": null
|
||||
"version": { "type": "rpgmaker_build" }
|
||||
},
|
||||
{
|
||||
"id": "re_engine",
|
||||
@@ -109,7 +109,7 @@
|
||||
{ "type": "sibling_glob", "value": "*.pck" },
|
||||
{ "type": "strings_contains", "value": "Godot Engine v" }
|
||||
] },
|
||||
"version": { "type": "strings_regex", "value": "Godot Engine v(\\d+\\.\\d+[\\.\\d]*)" }
|
||||
"version": { "type": "godot_build" }
|
||||
},
|
||||
{
|
||||
"id": "gamemaker",
|
||||
|
||||
@@ -198,12 +198,12 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter.",
|
||||
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter. beta.19 adds Unity's (the player library's version resource, the data file's header), Godot's (a data pack's header, the executable's version resource) and RPG Maker's (MV/MZ's core-script header, the RGSS library Game.ini names), decided by UnityVersion, GodotVersion and RpgMakerVersion.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["type"],
|
||||
"properties": {
|
||||
"type": { "const": "unreal_build" }
|
||||
"type": { "enum": ["unreal_build", "unity_build", "godot_build", "rpgmaker_build"] }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -77,7 +77,8 @@ public partial class App : System.Windows.Application
|
||||
HookCrashHandlers();
|
||||
// 08_UI §Accessibility (P4 PR-8): Esc closes the open ContentDialog or MessageBox, before any window exists.
|
||||
DialogKeyboard.Register();
|
||||
// beta.14: ui.hide_scrollbars reaches every scroller as it loads, those in a control's template too.
|
||||
// beta.14: ui.hide_scrollbars reaches every scroller as it is laid out (beta.17: not only as it loads), those in a
|
||||
// control's template too.
|
||||
ScrollBarHiding.Register();
|
||||
_run = DiagReport.Requested(e.Args) ? DiagAsync() : RunAsync();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
|
||||
Title="{x:Static res:Strings.Compare_Header}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!-- 08_UI §Compare: the picker (2–5, cross-game), the overlaid percentile curves, the stat table; FR-6.2's guard is the view model's. -->
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
Title="{x:Static res:Strings.Dashboard_Header}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts"
|
||||
Title="{x:Static res:Strings.Games_Header}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!--
|
||||
08_UI §Games › Game detail. The two rows — Supports (files on disk) and Last session measured (the
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
Title="{x:Static res:Strings.Games_Header}"
|
||||
AllowDrop="True"
|
||||
Drop="OnDrop"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<!--
|
||||
08_UI §Games: search, sort, FR-1.1 add by pick or by dropping an .exe here. Since beta.11 (owner requests 2026-10-03):
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
Title="{x:Static res:Strings.Logs_Header}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<Grid Margin="24,16,24,16">
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
Title="{x:Static res:Strings.Settings_Header}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
ScrollViewer.CanContentScroll="False">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
@@ -83,7 +84,7 @@
|
||||
Text="{x:Static res:Strings.Settings_Exceptions_Body}" />
|
||||
</StackPanel>
|
||||
<ui:ToggleSwitch Grid.Column="1" Margin="12,0" AutomationProperties.Name="{x:Static res:Strings.Settings_Exceptions_Label}"
|
||||
IsChecked="{Binding ViewModel.UserModeExceptions, Mode=TwoWay}" />
|
||||
IsChecked="{Binding ViewModel.UserModeExceptions, Mode=TwoWay}" IsEnabled="{Binding ViewModel.ActsOnThisPc}" />
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
<StackPanel>
|
||||
@@ -164,7 +165,8 @@
|
||||
Content="{x:Static res:Strings.Settings_SafetyDocs}"
|
||||
Icon="{ui:SymbolIcon Open24}" />
|
||||
|
||||
<!-- Recording policy: the three numbers and background capture (D16: the Agent reads them at session start). -->
|
||||
<!-- Recording policy: the three numbers and background capture (D16: the Agent reads them at session start) — off in a
|
||||
viewer, which has no Agent (beta.18; every setting the Agent reads is, ViewerModeTests). -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Policy_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Timer24}">
|
||||
<ui:CardControl.Header>
|
||||
@@ -175,6 +177,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_MinSession_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.MinSessionMaximum}"
|
||||
Minimum="{x:Static vm:SettingsViewModel.MinSessionMinimum}"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -189,6 +192,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_Interval_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.IntervalMaximum}"
|
||||
Minimum="{x:Static vm:SettingsViewModel.IntervalMinimum}"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -203,6 +207,7 @@
|
||||
</ui:CardControl.Header>
|
||||
<ui:NumberBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_Retention_Label}"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
Maximum="{x:Static vm:SettingsViewModel.RetentionMaximum}"
|
||||
Minimum="0"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
@@ -341,6 +346,7 @@
|
||||
<ComboBox MinWidth="140"
|
||||
AutomationProperties.Name="{x:Static res:Strings.Settings_UpdateChannel_Label}"
|
||||
DisplayMemberPath="Label"
|
||||
IsEnabled="{Binding ViewModel.ActsOnThisPc}"
|
||||
ItemsSource="{Binding ViewModel.UpdateChannels}"
|
||||
SelectedValue="{Binding ViewModel.UpdateChannel, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
|
||||
@@ -24,7 +24,8 @@ public sealed record AntiCheatExceptionResult(AntiCheatExceptionOutcome Outcome,
|
||||
RefusalText() ?? Detail ?? Strings.Common_NotAvailable),
|
||||
AntiCheatExceptionOutcome.VersionMismatch => Shared.Strings.Safety_Exception_VersionMismatch,
|
||||
AntiCheatExceptionOutcome.OptionOff => Shared.Strings.Safety_Exception_OptionOff,
|
||||
AntiCheatExceptionOutcome.AgentUnavailable => Shared.Strings.Safety_Consent_AgentUnavailable,
|
||||
// A grant and a withdrawal alike (beta.18): "Nothing was enabled." was the hooking consent's words, untrue for a withdrawal.
|
||||
AntiCheatExceptionOutcome.AgentUnavailable => Strings.Agent_NotConnected_NothingChanged,
|
||||
AntiCheatExceptionOutcome.Failed => Detail ?? Strings.Common_NotAvailable,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ public static class EmbeddedDocuments
|
||||
/// <summary>
|
||||
/// The user guide's pages in reading order (beta.12, D44; <c>guide/</c> in the repository). Each page's title is its
|
||||
/// first heading; <see cref="LimitationsDocument"/> closes the list, so the guide's links to it open in the window.
|
||||
/// beta.17 (D54): the four reference pages after the FAQ make the guide the wiki's End-user part too.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> GuidePages { get; } =
|
||||
[
|
||||
@@ -33,6 +34,10 @@ public static class EmbeddedDocuments
|
||||
"guide/04-anti-cheat-and-safety.md",
|
||||
"guide/05-your-data.md",
|
||||
"guide/06-faq.md",
|
||||
"guide/07-screens.md",
|
||||
"guide/08-settings.md",
|
||||
"guide/09-troubleshooting.md",
|
||||
"guide/10-glossary.md",
|
||||
"guide/terms-in-plain-words.md",
|
||||
];
|
||||
|
||||
|
||||
@@ -202,6 +202,38 @@ public static class Formats
|
||||
_ => id,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The engine's name as its version's witness names it (beta.19): each RPG Maker rule covers several makers, and the
|
||||
/// file the version was read from says which — MZ's or MV's core script, an RGSS1, RGSS2 or RGSS3 library (XP, VX,
|
||||
/// VX Ace). Any other engine, or no witness, is <see cref="Engine(string?)"/>.
|
||||
/// </summary>
|
||||
public static string Engine(string? id, string? versionSource) => (id, versionSource) switch
|
||||
{
|
||||
("rpgmaker_mv", EngineVersionSource.RpgMakerMzCore) => "RPG Maker MZ",
|
||||
("rpgmaker_mv", EngineVersionSource.RpgMakerMvCore) => "RPG Maker MV",
|
||||
("rpgmaker_rgss", EngineVersionSource.Rgss1Library) => "RPG Maker XP",
|
||||
("rpgmaker_rgss", EngineVersionSource.Rgss2Library) => "RPG Maker VX",
|
||||
("rpgmaker_rgss", EngineVersionSource.Rgss3Library) => "RPG Maker VX Ace",
|
||||
_ => Engine(id),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The engine and its version as one text (beta.19): "Unreal Engine 5.4.4", "Unity 2022.3.39f1", "Godot 4.4.1", "RPG Maker
|
||||
/// MZ 1.10.0" — and "RPG Maker VX Ace (RGSS 3.0.1)", whose number is its runtime library's, not the maker's.
|
||||
/// </summary>
|
||||
public static string EngineWithVersion(string? id, string? version, string? versionSource)
|
||||
{
|
||||
string name = Engine(id, versionSource);
|
||||
if (id is null || string.IsNullOrWhiteSpace(version))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
return versionSource is EngineVersionSource.Rgss1Library or EngineVersionSource.Rgss2Library or EngineVersionSource.Rgss3Library
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{name} (RGSS {version})")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{name} {version}");
|
||||
}
|
||||
|
||||
/// <summary>What an executable runs as (<c>games.exe_machine</c>, beta.8), in the user's language.</summary>
|
||||
public static string Architecture(string? id) => id switch
|
||||
{
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.IO;
|
||||
using FrameLedger.Infrastructure.Detection;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The folder Change executable… opens in (beta.19, owner request 2026-10-12): the game's own root folder rather than
|
||||
/// wherever Windows' dialog was last — the pick is almost always another file of the same install.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The root is <see cref="InstallRoot.Resolve"/>'s — the folder a store boundary names (<c>steamapps\common\X</c>,
|
||||
/// <c>GOG Galaxy\Games\X</c>, <c>Epic Games\X</c>, <c>GamesInstalled\X</c>) — and, where no boundary is recognised, out of
|
||||
/// an Unreal package's <c><root>\<Project>\Binaries\Win64</c> to <c><root></c>, else the executable's own
|
||||
/// folder. Only the row's path is stored (no install folder), so this is derived, never remembered.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// An entry whose folder is gone (*Not installed*) opens at the nearest folder above it that is still there; an entry on a
|
||||
/// drive that is not connected gets null, and the dialog opens where Windows last was. It asks the file system, so its
|
||||
/// caller runs it off the UI thread: a share that went away can take seconds to answer.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class GameFolder
|
||||
{
|
||||
/// <summary>The folder to open the pick in for an entry at <paramref name="exePath"/>, or null when there is none.</summary>
|
||||
public static string? StartFolder(string exePath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
|
||||
string full;
|
||||
try
|
||||
{
|
||||
full = Path.GetFullPath(exePath);
|
||||
}
|
||||
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string? drive = Path.GetPathRoot(full);
|
||||
if (string.IsNullOrEmpty(drive) || !Directory.Exists(drive))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string exeDirectory = Path.GetDirectoryName(full) ?? drive;
|
||||
string root = InstallRoot.Resolve(full);
|
||||
if (string.Equals(root, exeDirectory, StringComparison.OrdinalIgnoreCase) && UnrealRoot(exeDirectory) is { } unreal)
|
||||
{
|
||||
root = unreal;
|
||||
}
|
||||
|
||||
for (string? folder = root; !string.IsNullOrEmpty(folder); folder = Path.GetDirectoryName(folder))
|
||||
{
|
||||
if (Directory.Exists(folder))
|
||||
{
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
|
||||
return drive;
|
||||
}
|
||||
|
||||
/// <summary><c><root>\<Project>\Binaries\Win64</c> (or <c>WinGDK</c>) → <c><root></c>; null for any other folder.</summary>
|
||||
private static string? UnrealRoot(string exeDirectory)
|
||||
{
|
||||
string platform = Path.GetFileName(exeDirectory);
|
||||
string? binaries = Path.GetDirectoryName(exeDirectory);
|
||||
bool unreal = (string.Equals(platform, "Win64", StringComparison.OrdinalIgnoreCase) || string.Equals(platform, "WinGDK", StringComparison.OrdinalIgnoreCase))
|
||||
&& binaries is not null && string.Equals(Path.GetFileName(binaries), "Binaries", StringComparison.OrdinalIgnoreCase);
|
||||
string? project = unreal ? Path.GetDirectoryName(binaries) : null;
|
||||
return project is null ? null : Path.GetDirectoryName(project);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
@@ -8,7 +9,7 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>The WPF <see cref="OpenFileDialog"/> for FR-1.1.</summary>
|
||||
public sealed class GamePicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable()
|
||||
public string? PickExecutable(string? initialDirectory = null)
|
||||
{
|
||||
var dialog = new OpenFileDialog
|
||||
{
|
||||
@@ -17,6 +18,13 @@ public sealed class GamePicker : IGamePicker
|
||||
CheckFileExists = true,
|
||||
Multiselect = false,
|
||||
};
|
||||
|
||||
// InitialDirectory opens the dialog there whatever folder it remembers (DefaultDirectory would only be a fallback).
|
||||
if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory))
|
||||
{
|
||||
dialog.InitialDirectory = initialDirectory;
|
||||
}
|
||||
|
||||
return dialog.ShowDialog() == true ? dialog.FileName : null;
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,9 @@ namespace FrameLedger.App.Services;
|
||||
public interface IGamePicker
|
||||
{
|
||||
/// <summary>The chosen executable's full path, or null when the user cancelled.</summary>
|
||||
string? PickExecutable();
|
||||
/// <param name="initialDirectory">
|
||||
/// The folder the dialog opens in (beta.19: Change executable… opens in the game's own folder, <see cref="GameFolder"/>);
|
||||
/// null leaves it to Windows, which opens where the last pick was.
|
||||
/// </param>
|
||||
string? PickExecutable(string? initialDirectory = null);
|
||||
}
|
||||
@@ -55,13 +55,16 @@ public sealed class SafetyNotices : IDisposable
|
||||
return new SafetyNotice(SafetyNoticeKind.Unhooked, Strings.Notice_Unhooked_Title, TurnedOff(UnhookText(unhooked), unhooked.HookingTurnedOff), now);
|
||||
// The Agent's pre-scan of the library turned hooking off for a game the user had turned it on for (2026-09-25):
|
||||
// not a session event, so none of a refusal's "this run is still recorded" — no run is going on.
|
||||
// Its reason is the guard's own, and it is sent only for a finding about the game, which names its family.
|
||||
case IpcMessageType.HookingTurnedOff when IpcCodec.Payload<HookingTurnedOffEvent>(envelope) is { } off:
|
||||
return new SafetyNotice(SafetyNoticeKind.HookingOff,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_HookingOff_Title_Format, off.GameName ?? Strings.Common_NotAvailable),
|
||||
TurnedOff(RefusalText(off.Reason, off.Reason, off.Family, off.Signal), turnedOff: true), now);
|
||||
TurnedOff(GuardText(off.Reason, off.Family, off.Signal) ?? Shared.Strings.Safety_Refused_Unnamed, turnedOff: true), now);
|
||||
// The session's end in words (beta.18): it printed the enum's name — "The hook stopped (WriterSelfDisabled)" —
|
||||
// and said the session continued without measuring, while a stop ends it (07_IPC: measurement STOPPED).
|
||||
case IpcMessageType.CaptureDegraded when IpcCodec.Payload<CaptureDegradedEvent>(envelope) is { } degraded:
|
||||
return new SafetyNotice(SafetyNoticeKind.Degraded, Strings.Notice_Degraded_Title,
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Body_Format, degraded.Reason), now);
|
||||
Formats.EndReasonText(degraded.Reason) ?? string.Format(CultureInfo.CurrentCulture, Strings.Notice_Degraded_Unknown_Format, degraded.Reason), now);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -73,35 +76,45 @@ public sealed class SafetyNotices : IDisposable
|
||||
/// <summary>
|
||||
/// A driver or service that started on the PC mid-session is said as that (beta.13, §S23-3) — not "detected while the
|
||||
/// game was running … until you enable it again", which was untrue twice: such a finding turns no hooking off, and a
|
||||
/// finding about the game turns it off for good (the turned-off sentence follows).
|
||||
/// finding about the game turns it off for good (the turned-off sentence follows). A re-scan that could not look while
|
||||
/// the game still ran is said as that too (beta.18): it named its signal as a finding, "Access is denied was detected".
|
||||
/// </summary>
|
||||
private static string UnhookText(SafetyUnhookEvent unhooked) =>
|
||||
Formats.IsMachineWide(unhooked.GuardReason) && unhooked.Family is { } family
|
||||
? string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable)
|
||||
: string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable);
|
||||
|
||||
/// <summary><paramref name="reason"/> is the session's end reason; <paramref name="guardReason"/> the guard's own, when it named a family.</summary>
|
||||
private static string RefusalText(string reason, string? guardReason, string? family, string? signal)
|
||||
private static string UnhookText(SafetyUnhookEvent unhooked) => unhooked switch
|
||||
{
|
||||
if (string.Equals(reason, "PreScanCouldNotVerify", StringComparison.Ordinal))
|
||||
{
|
||||
return Shared.Strings.Safety_Refused_CouldNotVerify;
|
||||
}
|
||||
{ Family: { } family } when Formats.IsMachineWide(unhooked.GuardReason) =>
|
||||
string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_MachineWide_Format, family, unhooked.Signal ?? Strings.Common_NotAvailable),
|
||||
{ Family: null, GuardReason: { Length: > 0 } guardReason } =>
|
||||
string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Unnamed_Format, Formats.GuardReasonText(guardReason)),
|
||||
_ => string.Format(CultureInfo.CurrentCulture, Shared.Strings.Safety_Unhooked_Format, unhooked.Family ?? unhooked.Signal ?? Strings.Common_NotAvailable),
|
||||
};
|
||||
|
||||
if (string.Equals(reason, "TargetUnreadable", StringComparison.Ordinal))
|
||||
{
|
||||
return Shared.Strings.Safety_Refused_TargetUnreadable;
|
||||
}
|
||||
/// <summary>
|
||||
/// A refusal in words. <paramref name="reason"/> is the session's end; <paramref name="guardReason"/> the guard's own,
|
||||
/// sent for every refusal it gave since beta.18 (beside a family only, before).
|
||||
/// </summary>
|
||||
private static string RefusalText(string reason, string? guardReason, string? family, string? signal) => reason switch
|
||||
{
|
||||
"PreScanCouldNotVerify" => Shared.Strings.Safety_Refused_CouldNotVerify,
|
||||
"TargetUnreadable" => Shared.Strings.Safety_Refused_TargetUnreadable,
|
||||
// What the guard found, or could not do; from an agent that sent no reason beside no family, the end's own words.
|
||||
"RefusedByGuard" => GuardText(guardReason, family, signal) ?? Strings.End_RefusedByGuard,
|
||||
// The gate's own refusals (beta.18) — Disable all hooking, a game blocked before — are the user's switch or the row's,
|
||||
// never a finding. The gate labels them in the family's place, and the kill switch's notice read "kill switch was
|
||||
// detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)".
|
||||
// A name this build has no words for (a newer agent's) is named as it is, never as something detected.
|
||||
_ => Formats.EndReasonText(reason) ?? GuardText(guardReason, family, signal)
|
||||
?? (string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason)),
|
||||
};
|
||||
|
||||
// A refusal no anti-cheat family names (beta.8) — the guard could not look, the game is 32-bit — is said as what it
|
||||
// is. It used to name its SIGNAL as the family, and the notice read "Access is denied was detected in this game".
|
||||
if (family is null)
|
||||
{
|
||||
return string.IsNullOrEmpty(reason) ? Shared.Strings.Safety_Refused_Unnamed : Formats.GuardSentence(reason);
|
||||
}
|
||||
|
||||
return Formats.NamedRefusal(guardReason, family, signal ?? reason);
|
||||
}
|
||||
/// <summary>
|
||||
/// What the guard said, as a sentence: an anti-cheat it named, found in this game or on this PC; a refusal no family names
|
||||
/// (beta.8) in its own words — never its signal as the family, which read "Access is denied was detected in this game".
|
||||
/// Null when it said nothing.
|
||||
/// </summary>
|
||||
private static string? GuardText(string? guardReason, string? family, string? signal) =>
|
||||
family is { Length: > 0 }
|
||||
? Formats.NamedRefusal(guardReason, family, signal ?? Strings.Common_NotAvailable)
|
||||
: guardReason is { Length: > 0 } ? Formats.GuardSentence(guardReason) : null;
|
||||
|
||||
private void OnEvent(object? sender, AgentEventArgs e)
|
||||
{
|
||||
|
||||
@@ -10,13 +10,22 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>
|
||||
/// <c>ui.hide_scrollbars</c> (beta.14, owner request 2026-10-05): the App draws no scroll bars, and every scroller still
|
||||
/// scrolls — with the wheel, the keyboard and touch. A bar's visibility is bound in its scroller's template, so no style can
|
||||
/// reach it; this sets the scroller's own <see cref="ScrollBarVisibility"/> instead. One class handler on
|
||||
/// <see cref="ScrollViewer"/>'s <c>Loaded</c>, registered at start beside <see cref="DialogKeyboard"/>, sees every scroller the
|
||||
/// App shows, those inside a control's template too (a DataGrid's, a TextBox's, a rendered document's, a dialog's). While
|
||||
/// on, an axis whose bar is <see cref="ScrollBarVisibility.Auto"/> or <see cref="ScrollBarVisibility.Visible"/> becomes
|
||||
/// reach it; this sets the scroller's own <see cref="ScrollBarVisibility"/> instead, from two class handlers on
|
||||
/// <see cref="ScrollViewer"/> registered at start beside <see cref="DialogKeyboard"/>, which reach every scroller the App shows,
|
||||
/// those inside a control's template too (a DataGrid's, a TextBox's, a rendered document's, a dialog's):
|
||||
/// <list type="bullet">
|
||||
/// <item><c>ScrollChanged</c>, which every scroller raises from its first layout, when its extent and viewport stop being
|
||||
/// zero, and again whenever they change — inside the layout pass, so the bar is gone before the first frame is drawn.</item>
|
||||
/// <item><c>Loaded</c>, which beta.14 relied on alone, wrongly (beta.17, the owner's screenshot: the Dashboard kept its bar).
|
||||
/// WPF raises Loaded only on an element whose subtree listens for it with a handler of its own — an instance handler, a
|
||||
/// style's EventSetter, a template's trigger — and a class handler is none of those; WPF UI's toggle switches carry one,
|
||||
/// so Settings was hidden and the Dashboard, all cards and text, never was. It stays for a scroller that comes back with
|
||||
/// nothing to lay out again.</item>
|
||||
/// </list>
|
||||
/// While on, an axis whose bar is <see cref="ScrollBarVisibility.Auto"/> or <see cref="ScrollBarVisibility.Visible"/> becomes
|
||||
/// <see cref="ScrollBarVisibility.Hidden"/> — WPF's "no bar, still scrolls" — and its own value is remembered on it;
|
||||
/// <see cref="ScrollBarVisibility.Disabled"/> is never touched, because a disabled axis lays its content out at the viewport's
|
||||
/// size and wraps text. Off puts every remembered value back, on screen at once and on the next load for the rest.
|
||||
/// size and wraps text. Off puts every remembered value back, on screen at once and at the next layout for the rest.
|
||||
/// </summary>
|
||||
public static class ScrollBarHiding
|
||||
{
|
||||
@@ -32,11 +41,12 @@ public static class ScrollBarHiding
|
||||
/// <summary>Whether the bars are hidden right now.</summary>
|
||||
public static bool Hidden => _hidden;
|
||||
|
||||
/// <summary>Registers the class handler, once per process.</summary>
|
||||
/// <summary>Registers the class handlers, once per process.</summary>
|
||||
public static void Register()
|
||||
{
|
||||
if (Interlocked.Exchange(ref _registered, 1) == 0)
|
||||
{
|
||||
EventManager.RegisterClassHandler(typeof(ScrollViewer), ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(OnScrollChanged), handledEventsToo: true);
|
||||
EventManager.RegisterClassHandler(typeof(ScrollViewer), FrameworkElement.LoadedEvent, new RoutedEventHandler(OnLoaded), handledEventsToo: true);
|
||||
}
|
||||
}
|
||||
@@ -96,6 +106,15 @@ public static class ScrollBarHiding
|
||||
}
|
||||
}
|
||||
|
||||
// ScrollChanged bubbles: a scroller's ancestors that are scrollers hear it too, and each gets the same idempotent check.
|
||||
private static void OnScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
if (sender is ScrollViewer viewer)
|
||||
{
|
||||
Set(viewer);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Set(ScrollViewer viewer)
|
||||
{
|
||||
Axis(viewer, ScrollViewer.VerticalScrollBarVisibilityProperty, _ownVerticalProperty);
|
||||
|
||||
Generated
+36
-3
@@ -62,6 +62,7 @@ public static class Strings
|
||||
nameof(Agent_Banner_Offline_Body),
|
||||
nameof(Agent_Banner_Offline_Title),
|
||||
nameof(Agent_Banner_Retry),
|
||||
nameof(Agent_NotConnected_NothingChanged),
|
||||
nameof(Agent_State_Connected),
|
||||
nameof(Agent_State_Connecting),
|
||||
nameof(Agent_State_Elevating),
|
||||
@@ -445,8 +446,17 @@ public static class Strings
|
||||
nameof(GameDetail_Edit),
|
||||
nameof(GameDetail_EngineVersion_Branch),
|
||||
nameof(GameDetail_EngineVersion_BranchAndFile),
|
||||
nameof(GameDetail_EngineVersion_CoreScript_Format),
|
||||
nameof(GameDetail_EngineVersion_FileVersion),
|
||||
nameof(GameDetail_EngineVersion_GodotExe),
|
||||
nameof(GameDetail_EngineVersion_GodotPack),
|
||||
nameof(GameDetail_EngineVersion_GodotPackEmbedded),
|
||||
nameof(GameDetail_EngineVersion_NotFound),
|
||||
nameof(GameDetail_EngineVersion_NotFoundInFiles),
|
||||
nameof(GameDetail_EngineVersion_Rgss),
|
||||
nameof(GameDetail_EngineVersion_UnityData),
|
||||
nameof(GameDetail_EngineVersion_UnityPlayer),
|
||||
nameof(GameDetail_EngineVersion_UnityPlayerFile),
|
||||
nameof(GameDetail_Exception_Grant),
|
||||
nameof(GameDetail_Exception_Granted_Format),
|
||||
nameof(GameDetail_Exception_Header),
|
||||
@@ -645,8 +655,8 @@ public static class Strings
|
||||
nameof(Nav_Games),
|
||||
nameof(Nav_Logs),
|
||||
nameof(Nav_Settings),
|
||||
nameof(Notice_Degraded_Body_Format),
|
||||
nameof(Notice_Degraded_Title),
|
||||
nameof(Notice_Degraded_Unknown_Format),
|
||||
nameof(Notice_Dismiss),
|
||||
nameof(Notice_Error_Title),
|
||||
nameof(Notice_HookingOff_Title_Format),
|
||||
@@ -810,6 +820,7 @@ public static class Strings
|
||||
nameof(Settings_Interval_Body),
|
||||
nameof(Settings_Interval_Label),
|
||||
nameof(Settings_Invalid_Format),
|
||||
nameof(Settings_KillSwitch_Applied_On),
|
||||
nameof(Settings_KillSwitch_Body),
|
||||
nameof(Settings_KillSwitch_Label),
|
||||
nameof(Settings_KillSwitch_Off),
|
||||
@@ -1124,6 +1135,8 @@ public static class Strings
|
||||
|
||||
public static string Agent_Banner_Retry => ResourceManager.GetString(nameof(Agent_Banner_Retry), Culture) ?? nameof(Agent_Banner_Retry);
|
||||
|
||||
public static string Agent_NotConnected_NothingChanged => ResourceManager.GetString(nameof(Agent_NotConnected_NothingChanged), Culture) ?? nameof(Agent_NotConnected_NothingChanged);
|
||||
|
||||
public static string Agent_State_Connected => ResourceManager.GetString(nameof(Agent_State_Connected), Culture) ?? nameof(Agent_State_Connected);
|
||||
|
||||
public static string Agent_State_Connecting => ResourceManager.GetString(nameof(Agent_State_Connecting), Culture) ?? nameof(Agent_State_Connecting);
|
||||
@@ -1890,10 +1903,28 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_EngineVersion_BranchAndFile => ResourceManager.GetString(nameof(GameDetail_EngineVersion_BranchAndFile), Culture) ?? nameof(GameDetail_EngineVersion_BranchAndFile);
|
||||
|
||||
public static string GameDetail_EngineVersion_CoreScript_Format => ResourceManager.GetString(nameof(GameDetail_EngineVersion_CoreScript_Format), Culture) ?? nameof(GameDetail_EngineVersion_CoreScript_Format);
|
||||
|
||||
public static string GameDetail_EngineVersion_FileVersion => ResourceManager.GetString(nameof(GameDetail_EngineVersion_FileVersion), Culture) ?? nameof(GameDetail_EngineVersion_FileVersion);
|
||||
|
||||
public static string GameDetail_EngineVersion_GodotExe => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotExe), Culture) ?? nameof(GameDetail_EngineVersion_GodotExe);
|
||||
|
||||
public static string GameDetail_EngineVersion_GodotPack => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotPack), Culture) ?? nameof(GameDetail_EngineVersion_GodotPack);
|
||||
|
||||
public static string GameDetail_EngineVersion_GodotPackEmbedded => ResourceManager.GetString(nameof(GameDetail_EngineVersion_GodotPackEmbedded), Culture) ?? nameof(GameDetail_EngineVersion_GodotPackEmbedded);
|
||||
|
||||
public static string GameDetail_EngineVersion_NotFound => ResourceManager.GetString(nameof(GameDetail_EngineVersion_NotFound), Culture) ?? nameof(GameDetail_EngineVersion_NotFound);
|
||||
|
||||
public static string GameDetail_EngineVersion_NotFoundInFiles => ResourceManager.GetString(nameof(GameDetail_EngineVersion_NotFoundInFiles), Culture) ?? nameof(GameDetail_EngineVersion_NotFoundInFiles);
|
||||
|
||||
public static string GameDetail_EngineVersion_Rgss => ResourceManager.GetString(nameof(GameDetail_EngineVersion_Rgss), Culture) ?? nameof(GameDetail_EngineVersion_Rgss);
|
||||
|
||||
public static string GameDetail_EngineVersion_UnityData => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityData), Culture) ?? nameof(GameDetail_EngineVersion_UnityData);
|
||||
|
||||
public static string GameDetail_EngineVersion_UnityPlayer => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityPlayer), Culture) ?? nameof(GameDetail_EngineVersion_UnityPlayer);
|
||||
|
||||
public static string GameDetail_EngineVersion_UnityPlayerFile => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityPlayerFile), Culture) ?? nameof(GameDetail_EngineVersion_UnityPlayerFile);
|
||||
|
||||
public static string GameDetail_Exception_Grant => ResourceManager.GetString(nameof(GameDetail_Exception_Grant), Culture) ?? nameof(GameDetail_Exception_Grant);
|
||||
|
||||
public static string GameDetail_Exception_Granted_Format => ResourceManager.GetString(nameof(GameDetail_Exception_Granted_Format), Culture) ?? nameof(GameDetail_Exception_Granted_Format);
|
||||
@@ -2290,10 +2321,10 @@ public static class Strings
|
||||
|
||||
public static string Nav_Settings => ResourceManager.GetString(nameof(Nav_Settings), Culture) ?? nameof(Nav_Settings);
|
||||
|
||||
public static string Notice_Degraded_Body_Format => ResourceManager.GetString(nameof(Notice_Degraded_Body_Format), Culture) ?? nameof(Notice_Degraded_Body_Format);
|
||||
|
||||
public static string Notice_Degraded_Title => ResourceManager.GetString(nameof(Notice_Degraded_Title), Culture) ?? nameof(Notice_Degraded_Title);
|
||||
|
||||
public static string Notice_Degraded_Unknown_Format => ResourceManager.GetString(nameof(Notice_Degraded_Unknown_Format), Culture) ?? nameof(Notice_Degraded_Unknown_Format);
|
||||
|
||||
public static string Notice_Dismiss => ResourceManager.GetString(nameof(Notice_Dismiss), Culture) ?? nameof(Notice_Dismiss);
|
||||
|
||||
public static string Notice_Error_Title => ResourceManager.GetString(nameof(Notice_Error_Title), Culture) ?? nameof(Notice_Error_Title);
|
||||
@@ -2620,6 +2651,8 @@ public static class Strings
|
||||
|
||||
public static string Settings_Invalid_Format => ResourceManager.GetString(nameof(Settings_Invalid_Format), Culture) ?? nameof(Settings_Invalid_Format);
|
||||
|
||||
public static string Settings_KillSwitch_Applied_On => ResourceManager.GetString(nameof(Settings_KillSwitch_Applied_On), Culture) ?? nameof(Settings_KillSwitch_Applied_On);
|
||||
|
||||
public static string Settings_KillSwitch_Body => ResourceManager.GetString(nameof(Settings_KillSwitch_Body), Culture) ?? nameof(Settings_KillSwitch_Body);
|
||||
|
||||
public static string Settings_KillSwitch_Label => ResourceManager.GetString(nameof(Settings_KillSwitch_Label), Culture) ?? nameof(Settings_KillSwitch_Label);
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
<value>キャプチャエージェントがオフライン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>キャプチャエージェントに接続されていません。何も変更されていません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>再試行</value>
|
||||
<comment>review</comment>
|
||||
@@ -1833,8 +1837,8 @@
|
||||
<value>アプリ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>フックが停止しました ({0})。セッションは実測なしで続行します。</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>計測を停止しました ({0})。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
@@ -1921,6 +1925,10 @@
|
||||
<value>適用しました。キャプチャエージェントは次回のセッション開始時に読み込みます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>すべてのフックを無効にしました。実測中のゲームは次回の安全スキャン (30 秒以内) で実測を停止します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>キャプチャ</value>
|
||||
<comment>review</comment>
|
||||
@@ -2262,7 +2270,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io のインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、ゲームページの「ファイル ▸ ライブラリを取り込む…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
|
||||
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io のインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、「ファイル ▸ ライブラリをインポート…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
@@ -2913,6 +2921,42 @@
|
||||
<value>ゲームの実行ファイル内に見つかりません。実行ファイルが圧縮・保護されているか、スタジオがエンジンのビルド名を変更している可能性があります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
|
||||
<value>ゲームの Unity プレーヤーライブラリ(UnityPlayer.dll)のバージョンから。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
|
||||
<value>ゲームの Unity データファイル(globalgamemanagers)の先頭から。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
|
||||
<value>Unity プレーヤーライブラリのバージョン番号のみから。リリースを示す文字(f1 など)はそこに記録されていません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
|
||||
<value>ゲームの Godot データパック(.pck)の先頭から。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
|
||||
<value>ゲームの実行ファイルに含まれる Godot データパックの先頭から。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
|
||||
<value>Godot がゲームの実行ファイルに残したバージョン情報から。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
|
||||
<value>ゲームの {0} の最初の行から。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
|
||||
<value>ゲームの Game.ini が指定する RPG Maker のランタイムライブラリ(RGSS)から。この番号はエディターではなくライブラリのものです。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
|
||||
<value>ゲームのファイルには見つかりません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Libraries" xml:space="preserve">
|
||||
<value>同梱ライブラリ</value>
|
||||
<comment>review</comment>
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<data name="Agent_Banner_Offline_Title" xml:space="preserve">
|
||||
<value>Capture agent offline</value>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>The capture agent is not connected. Nothing was changed.</value>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>Retry</value>
|
||||
</data>
|
||||
@@ -1380,8 +1383,8 @@
|
||||
<data name="Logs_Source_Ui" xml:space="preserve">
|
||||
<value>App</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>The hook stopped ({0}); the session continues without measuring.</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>Measuring stopped ({0}).</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
<value>Measurement stopped</value>
|
||||
@@ -1446,6 +1449,9 @@
|
||||
<data name="Settings_Applied" xml:space="preserve">
|
||||
<value>Applied. The capture agent reads it at the next session start.</value>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>All hooking is off. A game being measured stops being measured at its next safety scan, within 30 seconds.</value>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>Capture</value>
|
||||
</data>
|
||||
@@ -1702,7 +1708,7 @@
|
||||
<value>Finish</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger can read what Steam, GOG Galaxy, Epic and itch.io have installed and add them from a checklist — File ▸ Import library… on the Games page, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
|
||||
<value>FrameLedger can read what Steam, GOG Galaxy, Epic and itch.io have installed and add them from a checklist — File ▸ Import library…, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
<value>Your library</value>
|
||||
@@ -2195,6 +2201,33 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="GameDetail_EngineVersion_NotFound" xml:space="preserve">
|
||||
<value>Not found in the game's executable. It may be packed or protected, or the studio renamed the engine's build.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
|
||||
<value>From the version of the game's Unity player library (UnityPlayer.dll).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
|
||||
<value>From the header of the game's Unity data file (globalgamemanagers).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
|
||||
<value>From the Unity player library's version number only. The release letter (such as f1) is not recorded there.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
|
||||
<value>From the header of the game's Godot data pack (.pck).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
|
||||
<value>From the header of the Godot data pack inside the game's executable.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
|
||||
<value>From the version information Godot left in the game's executable.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
|
||||
<value>From the first lines of the game's {0}.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
|
||||
<value>From the RPG Maker runtime library (RGSS) that the game's Game.ini names. The number is the library's, not the editor's.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
|
||||
<value>Not found in the game's files.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Libraries" xml:space="preserve">
|
||||
<value>Ships with</value>
|
||||
</data>
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<data name="Agent_Banner_Offline_Title" xml:space="preserve">
|
||||
<value>Capture agent ngoại tuyến</value>
|
||||
</data>
|
||||
<data name="Agent_NotConnected_NothingChanged" xml:space="preserve">
|
||||
<value>Capture agent chưa kết nối. Không có gì thay đổi.</value>
|
||||
</data>
|
||||
<data name="Agent_Banner_Retry" xml:space="preserve">
|
||||
<value>Thử lại</value>
|
||||
</data>
|
||||
@@ -1375,8 +1378,8 @@
|
||||
<data name="Logs_Source_Ui" xml:space="preserve">
|
||||
<value>Ứng dụng</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Body_Format" xml:space="preserve">
|
||||
<value>Hook đã dừng ({0}); phiên tiếp tục mà không đo.</value>
|
||||
<data name="Notice_Degraded_Unknown_Format" xml:space="preserve">
|
||||
<value>Việc đo đã dừng ({0}).</value>
|
||||
</data>
|
||||
<data name="Notice_Degraded_Title" xml:space="preserve">
|
||||
<value>Đã dừng đo</value>
|
||||
@@ -1441,6 +1444,9 @@
|
||||
<data name="Settings_Applied" xml:space="preserve">
|
||||
<value>Đã áp dụng. Capture agent đọc ở lần bắt đầu phiên kế tiếp.</value>
|
||||
</data>
|
||||
<data name="Settings_KillSwitch_Applied_On" xml:space="preserve">
|
||||
<value>Đã tắt toàn bộ hooking. Game đang được đo sẽ dừng đo ở lần quét an toàn kế tiếp, trong vòng 30 giây.</value>
|
||||
</data>
|
||||
<data name="Settings_Capture_Header" xml:space="preserve">
|
||||
<value>Thu thập</value>
|
||||
</data>
|
||||
@@ -1697,7 +1703,7 @@
|
||||
<value>Hoàn tất</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Body" xml:space="preserve">
|
||||
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic và itch.io đã cài và thêm chúng từ một danh sách chọn — File ▸ Nhập thư viện… ở trang Game, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
|
||||
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic và itch.io đã cài và thêm chúng từ một danh sách chọn — Tệp ▸ Nhập thư viện…, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
|
||||
</data>
|
||||
<data name="FirstRun_Import_Header" xml:space="preserve">
|
||||
<value>Thư viện của bạn</value>
|
||||
@@ -2190,6 +2196,33 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="GameDetail_EngineVersion_NotFound" xml:space="preserve">
|
||||
<value>Không tìm thấy trong file thực thi của game. File có thể đã bị nén hoặc bảo vệ, hoặc studio đã đổi tên bản dựng của engine.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayer" xml:space="preserve">
|
||||
<value>Lấy từ phiên bản thư viện Unity player của game (UnityPlayer.dll).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityData" xml:space="preserve">
|
||||
<value>Lấy từ phần đầu file dữ liệu Unity của game (globalgamemanagers).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_UnityPlayerFile" xml:space="preserve">
|
||||
<value>Chỉ lấy từ số phiên bản của thư viện Unity player. Chữ cái của bản phát hành (như f1) không được ghi ở đó.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPack" xml:space="preserve">
|
||||
<value>Lấy từ phần đầu gói dữ liệu Godot của game (.pck).</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotPackEmbedded" xml:space="preserve">
|
||||
<value>Lấy từ phần đầu gói dữ liệu Godot nằm trong file thực thi của game.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_GodotExe" xml:space="preserve">
|
||||
<value>Lấy từ thông tin phiên bản mà Godot để lại trong file thực thi của game.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_CoreScript_Format" xml:space="preserve">
|
||||
<value>Lấy từ những dòng đầu của {0} trong game.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
|
||||
<value>Lấy từ thư viện runtime RPG Maker (RGSS) mà file Game.ini của game chỉ định. Đây là số phiên bản của thư viện, không phải của trình biên tập.</value>
|
||||
</data>
|
||||
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
|
||||
<value>Không tìm thấy trong các file của game.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Details_Libraries" xml:space="preserve">
|
||||
<value>Đi kèm</value>
|
||||
</data>
|
||||
|
||||
@@ -26,7 +26,7 @@ public sealed class GameCardViewModel
|
||||
Id = card.Row.Id;
|
||||
Name = card.Row.Name;
|
||||
PlatformText = Formats.Platform(card.Row.Platform);
|
||||
EngineText = Formats.Engine(card.Row.Engine);
|
||||
EngineText = Formats.Engine(card.Row.Engine, card.Row.EngineVersionSource);
|
||||
Recorded = card.Row.RecordSessions;
|
||||
HookOn = Recorded && card.Row.HookEnabled;
|
||||
// An entry the guard found anti-cheat in says so (beta.8): its hooking is off for good, and "Hooking off" read as
|
||||
|
||||
@@ -755,7 +755,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
try
|
||||
{
|
||||
HookingConsentResult result = await _consent.DisableAsync(Game.Id).ConfigureAwait(true);
|
||||
Notice(result);
|
||||
Notice(result, turningOff: true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -801,7 +801,8 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
/// <summary>
|
||||
/// A store import guesses the executable (Steam names none), and everything downstream is keyed on it: a wrong guess
|
||||
/// is a game that can never be matched. The pick is the user's own; the row comes back hooking-off and unconsented,
|
||||
/// exactly as a new game would, and consent is revoked over the pipe first, as removal does.
|
||||
/// exactly as a new game would, and consent is revoked over the pipe first, as removal does. The dialog opens in the
|
||||
/// game's own folder (beta.19, <see cref="GameFolder"/>), asked off the UI thread.
|
||||
/// </summary>
|
||||
private async Task ChangeExecutableCoreAsync()
|
||||
{
|
||||
@@ -810,7 +811,9 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
string? path = _picker.PickExecutable();
|
||||
string current = Game.Fingerprint.ExePath;
|
||||
string? folder = await Task.Run(() => GameFolder.StartFolder(current)).ConfigureAwait(true);
|
||||
string? path = _picker.PickExecutable(folder);
|
||||
if (path is null || string.Equals(ExecutableIdentity.Normalise(path), Game.Fingerprint.ExePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
@@ -940,14 +943,17 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
OnPropertyChanged(nameof(NoticeVisible));
|
||||
}
|
||||
|
||||
/// <summary>A refusal, a mismatch or a failure is a persistent notice on the page; a success clears it.</summary>
|
||||
private void Notice(HookingConsentResult result)
|
||||
/// <summary>
|
||||
/// A refusal, a mismatch or a failure is a persistent notice on the page; a success clears it. With no Agent, turning
|
||||
/// hooking off changed nothing — not "Nothing was enabled.", the enable path's words, which it said until beta.18.
|
||||
/// </summary>
|
||||
private void Notice(HookingConsentResult result, bool turningOff = false)
|
||||
{
|
||||
(NoticeText, NoticeSeverity) = result.Outcome switch
|
||||
{
|
||||
HookingConsentOutcome.Refused => (result.RefusalText(), InfoBarSeverity.Error),
|
||||
HookingConsentOutcome.VersionMismatch => (Shared.Strings.Safety_Consent_VersionMismatch, InfoBarSeverity.Warning),
|
||||
HookingConsentOutcome.AgentUnavailable => (Shared.Strings.Safety_Consent_AgentUnavailable, InfoBarSeverity.Warning),
|
||||
HookingConsentOutcome.AgentUnavailable => (turningOff ? Strings.Agent_NotConnected_NothingChanged : Shared.Strings.Safety_Consent_AgentUnavailable, InfoBarSeverity.Warning),
|
||||
// The Agent could not read the executable (beta.8): say whether its drive or the file is missing, not the IPC code.
|
||||
HookingConsentOutcome.Failed when string.Equals(result.Detail, Shared.Ipc.IpcErrorCode.ExecutableUnreadable, StringComparison.Ordinal) && Game is not null
|
||||
=> (Formats.ExecutableMissingText(Game.Fingerprint.ExePath), InfoBarSeverity.Warning),
|
||||
@@ -1163,13 +1169,12 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
SessionsEmpty = Sessions.Count == 0;
|
||||
}
|
||||
|
||||
private static string EngineText(GameRow row) =>
|
||||
row.Engine is null || row.EngineVersion is null ? Formats.Engine(row.Engine) : Formats.Engine(row.Engine) + " " + row.EngineVersion;
|
||||
private static string EngineText(GameRow row) => Formats.EngineWithVersion(row.Engine, row.EngineVersion, row.EngineVersionSource);
|
||||
|
||||
/// <summary>
|
||||
/// Which witness an Unreal Engine version rests on (beta.10, schema 0015) — said, because the executable's version
|
||||
/// number and the engine's build name can each be wrong in their own way (<c>05_DETECTION</c> §Engine version). An
|
||||
/// Unreal title whose executable names no version says so once the sweep has read it; other engines add no line.
|
||||
/// Which witness an engine version rests on (beta.10 for Unreal, schema 0015; beta.19 for Unity, Godot and RPG Maker) —
|
||||
/// said, because each witness can be wrong or short in its own way (<c>05_DETECTION</c> §Engine version). A title of
|
||||
/// these engines whose files name no version says so once the sweep has read it; other engines add no line.
|
||||
/// </summary>
|
||||
internal static string? EngineVersionSourceText(GameRow row)
|
||||
{
|
||||
@@ -1179,8 +1184,19 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
EngineVersionSource.UnrealBranchAndFile => Strings.GameDetail_EngineVersion_BranchAndFile,
|
||||
EngineVersionSource.UnrealBranch => Strings.GameDetail_EngineVersion_Branch,
|
||||
EngineVersionSource.UnrealFileVersion => Strings.GameDetail_EngineVersion_FileVersion,
|
||||
EngineVersionSource.UnityPlayer => Strings.GameDetail_EngineVersion_UnityPlayer,
|
||||
EngineVersionSource.UnityData => Strings.GameDetail_EngineVersion_UnityData,
|
||||
EngineVersionSource.UnityPlayerFile => Strings.GameDetail_EngineVersion_UnityPlayerFile,
|
||||
EngineVersionSource.GodotPack => Strings.GameDetail_EngineVersion_GodotPack,
|
||||
EngineVersionSource.GodotPackEmbedded => Strings.GameDetail_EngineVersion_GodotPackEmbedded,
|
||||
EngineVersionSource.GodotExe => Strings.GameDetail_EngineVersion_GodotExe,
|
||||
EngineVersionSource.RpgMakerMzCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "js/rmmz_core.js"),
|
||||
EngineVersionSource.RpgMakerMvCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "rpg_core.js"),
|
||||
EngineVersionSource.Rgss1Library or EngineVersionSource.Rgss2Library or EngineVersionSource.Rgss3Library => Strings.GameDetail_EngineVersion_Rgss,
|
||||
null when string.Equals(row.Engine, "unreal", StringComparison.Ordinal) && row.EngineVersion is null && row.ExeMachine is not null
|
||||
=> Strings.GameDetail_EngineVersion_NotFound,
|
||||
null when row.Engine is "unity" or "godot" or "rpgmaker_mv" or "rpgmaker_rgss" && row.EngineVersion is null && row.ExeMachine is not null
|
||||
=> Strings.GameDetail_EngineVersion_NotFoundInFiles,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -712,7 +712,8 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
string body = result.Outcome == HookingConsentOutcome.AgentUnavailable ? Shared.Strings.Safety_Consent_AgentUnavailable : result.Detail ?? Strings.Common_NotAvailable;
|
||||
// Turning off with no Agent changed nothing (beta.18): it said the enable path's "Nothing was enabled."
|
||||
string body = result.Outcome == HookingConsentOutcome.AgentUnavailable ? Strings.Agent_NotConnected_NothingChanged : result.Detail ?? Strings.Common_NotAvailable;
|
||||
_strip.Warn(game.Name, body);
|
||||
}
|
||||
|
||||
@@ -765,7 +766,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
await _settings.SetAsync(definition, value).ConfigureAwait(true);
|
||||
if (definition.AgentReads)
|
||||
{
|
||||
_strip.Info(Strings.Settings_Header, Strings.Settings_Applied);
|
||||
// Disable all hooking does not wait for a session to start (beta.18): a measured one stops at its next safety scan.
|
||||
bool killSwitchOn = ReferenceEquals(definition, SettingsRegistry.HookingKillSwitch) && string.Equals(value, "1", StringComparison.Ordinal);
|
||||
_strip.Info(Strings.Settings_Header, killSwitchOn ? Strings.Settings_KillSwitch_Applied_On : Strings.Settings_Applied);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,4 +24,23 @@ public interface IGameFileProbe
|
||||
/// file. Null when no shipping executable is in the snapshot's listing or it could not be read: no facts, never a guess.
|
||||
/// </summary>
|
||||
ValueTask<UnrealBuildFacts?> ReadUnrealBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Unity's build facts (beta.19) — the player library's version resource and the header of its data file — asked only
|
||||
/// after the rules matched an engine whose extractor is <see cref="VersionExtractorType.UnityBuild"/>. Null when neither
|
||||
/// file is there or could be read.
|
||||
/// </summary>
|
||||
ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Godot's build facts (beta.19) — a data pack's header, beside the executable or appended to it, and the executable's
|
||||
/// version resource — for <see cref="VersionExtractorType.GodotBuild"/>. Null when nothing could be read.
|
||||
/// </summary>
|
||||
ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// RPG Maker's build facts (beta.19) — MV/MZ's core-script header, or the RGSS library <c>Game.ini</c> names — for
|
||||
/// <see cref="VersionExtractorType.RpgMakerBuild"/>. Null when neither is found.
|
||||
/// </summary>
|
||||
ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
|
||||
}
|
||||
@@ -59,8 +59,9 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The matched engine's version and its witness. Every extractor but one answers from the snapshot; Unreal's is the
|
||||
/// second read (beta.10), made here for the one engine that matched rather than by the probe for every game.
|
||||
/// The matched engine's version and its witness. The rules' own extractors answer from the snapshot; an engine whose
|
||||
/// version is decided in code — Unreal since beta.10, Unity, Godot and RPG Maker since beta.19 — gets one second read,
|
||||
/// made here for the one engine that matched rather than by the probe for every game.
|
||||
/// </summary>
|
||||
private async ValueTask<EngineVersionReading> VersionAsync(EngineMatch engine, GameFileSnapshot snapshot, CancellationToken ct)
|
||||
{
|
||||
@@ -69,12 +70,18 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
|
||||
return EngineVersionReading.None;
|
||||
}
|
||||
|
||||
if (extractor.Type != VersionExtractorType.UnrealBuild)
|
||||
switch (extractor.Type)
|
||||
{
|
||||
return engine.Version is null ? EngineVersionReading.None : new EngineVersionReading(engine.Version, EngineVersionSource.Of(extractor.Type));
|
||||
case VersionExtractorType.UnrealBuild:
|
||||
return await _probe.ReadUnrealBuildAsync(snapshot, ct).ConfigureAwait(false) is { } unreal ? UnrealVersion.Decide(unreal) : EngineVersionReading.None;
|
||||
case VersionExtractorType.UnityBuild:
|
||||
return await _probe.ReadUnityBuildAsync(snapshot, ct).ConfigureAwait(false) is { } unity ? UnityVersion.Decide(unity) : EngineVersionReading.None;
|
||||
case VersionExtractorType.GodotBuild:
|
||||
return await _probe.ReadGodotBuildAsync(snapshot, ct).ConfigureAwait(false) is { } godot ? GodotVersion.Decide(godot) : EngineVersionReading.None;
|
||||
case VersionExtractorType.RpgMakerBuild:
|
||||
return await _probe.ReadRpgMakerBuildAsync(snapshot, ct).ConfigureAwait(false) is { } maker ? RpgMakerVersion.Decide(maker) : EngineVersionReading.None;
|
||||
default:
|
||||
return engine.Version is null ? EngineVersionReading.None : new EngineVersionReading(engine.Version, EngineVersionSource.Of(extractor.Type));
|
||||
}
|
||||
|
||||
UnrealBuildFacts? facts = await _probe.ReadUnrealBuildAsync(snapshot, ct).ConfigureAwait(false);
|
||||
return facts is null ? EngineVersionReading.None : UnrealVersion.Decide(facts);
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,12 @@ public sealed class LibraryImporter
|
||||
bool missing = exe is not null && _identity.Read(exe) is null;
|
||||
bool already = exe is not null && await _games.FindAsync(exe, ct).ConfigureAwait(false) is { InLibrary: true };
|
||||
string? movedFrom = exe is null || already ? null : StaleTwinOf(exe, library)?.Fingerprint.ExePath;
|
||||
if (exe is not null && !already && movedFrom is null && SameStoreTitleOf(game, library) is { } entry)
|
||||
{
|
||||
already = true;
|
||||
_log($"import: {game.Name} ({game.Platform} {game.StoreId}) is already in the library as {entry.Fingerprint.ExePath} — not offered again at {exe}");
|
||||
}
|
||||
|
||||
candidates.Add(new ImportCandidate(game, exe, already, guessed, missing, movedFrom));
|
||||
}
|
||||
|
||||
@@ -130,4 +136,23 @@ public sealed class LibraryImporter
|
||||
/// </summary>
|
||||
private GameRow? StaleTwinOf(string exe, IReadOnlyList<GameRow> library) =>
|
||||
library.FirstOrDefault(r => ExecutableRelocator.IsDriveLetterTwin(r.Fingerprint.ExePath, exe) && _identity.Read(r.Fingerprint.ExePath) is null);
|
||||
|
||||
/// <summary>
|
||||
/// The library entry an earlier import made for this very store title, at another executable (beta.19): the store's id,
|
||||
/// under the same platform or with the entry's executable inside the title's install folder. The import used to compare
|
||||
/// paths only, so a guess that changed between builds — A Doll's Locket - Remake's helper became its NW.js runtime —
|
||||
/// would have offered the same game again beside the entry the user already has; that entry is what Change executable…
|
||||
/// re-points. The folder half is there because the platform is the detection sweep's to refresh: an itch build that
|
||||
/// ships Steam's API reads as Steam. A title with no store id is never matched.
|
||||
/// </summary>
|
||||
private static GameRow? SameStoreTitleOf(StoreGame game, IReadOnlyList<GameRow> library) =>
|
||||
string.IsNullOrEmpty(game.StoreId)
|
||||
? null
|
||||
: library.FirstOrDefault(r => string.Equals(r.StoreId, game.StoreId, StringComparison.Ordinal)
|
||||
&& (string.Equals(r.Platform, game.Platform, StringComparison.OrdinalIgnoreCase)
|
||||
|| IsInside(r.Fingerprint.ExePath, game.InstallDirectory)));
|
||||
|
||||
private static bool IsInside(string path, string directory) =>
|
||||
!string.IsNullOrEmpty(directory)
|
||||
&& path.StartsWith(Path.TrimEndingDirectorySeparator(directory) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
@@ -161,8 +161,12 @@ public static class RecordedSessionEvents
|
||||
private static string? NullIfEmpty(string? value) => string.IsNullOrEmpty(value) ? null : value;
|
||||
|
||||
/// <summary>
|
||||
/// The guard's own reason when it named a family (beta.13, §S23-3): the App says a <c>BlockedService</c> or
|
||||
/// <c>BlockedDriver</c> was found on the PC, not in the game. Null when the guard named nothing.
|
||||
/// The guard's own reason whenever it refused: the App says a <c>BlockedService</c> or <c>BlockedDriver</c> was found on
|
||||
/// the PC, not in the game (beta.13, §S23-3), and a refusal no family names in the guard's words — "the game is 32-bit…",
|
||||
/// "the game's loaded modules could not be listed" — rather than by the session's end reason, which printed as
|
||||
/// <c>reason RefusedByGuard</c> (beta.18). Until beta.18 it was sent only beside a family. Null for an allow, and for a
|
||||
/// verdict nobody produced.
|
||||
/// </summary>
|
||||
private static string? GuardReasonOf(AntiCheatVerdict verdict) => string.IsNullOrEmpty(verdict.Family) ? null : verdict.Reason.ToString();
|
||||
private static string? GuardReasonOf(AntiCheatVerdict verdict) =>
|
||||
verdict.Reason is AntiCheatRefusalReason.Allow or AntiCheatRefusalReason.AllowedUnderUserModeException ? null : verdict.Reason.ToString();
|
||||
}
|
||||
@@ -18,6 +18,39 @@ public static class EngineVersionSource
|
||||
/// <summary>Unreal: the numeric file version alone, where nothing suggests the studio replaced it.</summary>
|
||||
public const string UnrealFileVersion = "unreal_file_version";
|
||||
|
||||
/// <summary>Unity (beta.19): the player library's <c>ProductVersion</c>, an editor version with its release letter.</summary>
|
||||
public const string UnityPlayer = "unity_player";
|
||||
|
||||
/// <summary>Unity: the editor version the data file's header names.</summary>
|
||||
public const string UnityData = "unity_data";
|
||||
|
||||
/// <summary>Unity: the player library's numeric file version — MAJOR.MINOR.PATCH, no release letter.</summary>
|
||||
public const string UnityPlayerFile = "unity_player_file";
|
||||
|
||||
/// <summary>Godot (beta.19): the header of the data pack beside the executable.</summary>
|
||||
public const string GodotPack = "godot_pck";
|
||||
|
||||
/// <summary>Godot: the header of the data pack appended to the executable.</summary>
|
||||
public const string GodotPackEmbedded = "godot_pck_embedded";
|
||||
|
||||
/// <summary>Godot: the executable's version resource, still the engine's (<c>ProductName</c> is "Godot Engine").</summary>
|
||||
public const string GodotExe = "godot_exe";
|
||||
|
||||
/// <summary>RPG Maker MZ (beta.19): the header of <c>js/rmmz_core.js</c>.</summary>
|
||||
public const string RpgMakerMzCore = "rpgmaker_mz_core";
|
||||
|
||||
/// <summary>RPG Maker MV: the header of <c>rpg_core.js</c>.</summary>
|
||||
public const string RpgMakerMvCore = "rpgmaker_mv_core";
|
||||
|
||||
/// <summary>RPG Maker XP: the RGSS1 library <c>Game.ini</c> names.</summary>
|
||||
public const string Rgss1Library = "rgss1_library";
|
||||
|
||||
/// <summary>RPG Maker VX: the RGSS2 library.</summary>
|
||||
public const string Rgss2Library = "rgss2_library";
|
||||
|
||||
/// <summary>RPG Maker VX Ace: the RGSS3 library.</summary>
|
||||
public const string Rgss3Library = "rgss3_library";
|
||||
|
||||
/// <summary>The rule's own extractor, named as the rules file names it (<c>pe_file_version</c>, <c>strings_regex</c>, …).</summary>
|
||||
public static string Of(VersionExtractorType type) => type switch
|
||||
{
|
||||
@@ -26,6 +59,9 @@ public static class EngineVersionSource
|
||||
VersionExtractorType.StringsRegex => "strings_regex",
|
||||
VersionExtractorType.ManifestField => "manifest_field",
|
||||
VersionExtractorType.UnrealBuild => "unreal_build",
|
||||
VersionExtractorType.UnityBuild => "unity_build",
|
||||
VersionExtractorType.GodotBuild => "godot_build",
|
||||
VersionExtractorType.RpgMakerBuild => "rpgmaker_build",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, "not a version extractor"),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// What a Godot title's own files say about the engine it was exported with (beta.19), read from the files on disk.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A Godot export's data pack starts with a header — the magic <c>GDPC</c>, the pack format, then the engine's MAJOR, MINOR
|
||||
/// and PATCH — whether it sits beside the executable (<c>Game.pck</c>) or is appended to it. Measured 2026-10-12 on the
|
||||
/// owner's two Godot installs: Plethora of Bullets 2 (format 2, 4.2.2) and 衔蝶 (format 2, 4.4.1). The executable's
|
||||
/// own <c>Godot Engine v4.4.1.stable.official</c> string sits 57 to 78 MB into it — past the 8 MiB the rules' strings scan
|
||||
/// reads, which is why the old <c>strings_regex</c> extractor never found it.
|
||||
/// </remarks>
|
||||
public sealed record GodotBuildFacts
|
||||
{
|
||||
/// <summary>The engine's MAJOR, MINOR and PATCH from a data pack's header, or null when no header was read.</summary>
|
||||
public IReadOnlyList<int>? PackVersion { get; init; }
|
||||
|
||||
/// <summary>True when that header was read from a pack appended to the executable, not from a <c>.pck</c> beside it.</summary>
|
||||
public bool PackEmbedded { get; init; }
|
||||
|
||||
/// <summary>The executable's <c>ProductName</c>, or null.</summary>
|
||||
public string? ExeProductName { get; init; }
|
||||
|
||||
/// <summary>The executable's <c>ProductVersion</c>, or null.</summary>
|
||||
public string? ExeProductVersion { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>The Godot version a title was exported with (beta.19), decided from <see cref="GodotBuildFacts"/> — or nothing.</summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The ladder:</b> (1) a data pack's header, beside the executable or appended to it — the engine writes its own
|
||||
/// version there; (2) the executable's version resource, only while its <c>ProductName</c> is still <c>Godot Engine</c>:
|
||||
/// an export whose project set no version information keeps the engine's (<c>4.2.2.stable.official</c> on Plethora of
|
||||
/// Bullets 2), and one that set its own carries the game's (衔蝶: <c>0.1.0.3</c>), which is not the engine's.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// A zero patch is not written, because Godot does not write it: 4.3, 4.2.2.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static partial class GodotVersion
|
||||
{
|
||||
/// <summary>The product name a Godot export keeps when its project set none.</summary>
|
||||
public const string EngineProductName = "Godot Engine";
|
||||
|
||||
/// <summary>The version these facts establish, and the witness it rests on.</summary>
|
||||
public static EngineVersionReading Decide(GodotBuildFacts facts)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(facts);
|
||||
|
||||
if (facts.PackVersion is { Count: >= 3 } pack && Format(pack[0], pack[1], pack[2]) is { } fromPack)
|
||||
{
|
||||
return new EngineVersionReading(fromPack, facts.PackEmbedded ? EngineVersionSource.GodotPackEmbedded : EngineVersionSource.GodotPack);
|
||||
}
|
||||
|
||||
if (string.Equals(facts.ExeProductName?.Trim(), EngineProductName, StringComparison.OrdinalIgnoreCase)
|
||||
&& facts.ExeProductVersion is { } text && ProductShape().Match(text.Trim()) is { Success: true } m
|
||||
&& Format(Parse(m.Groups["major"].Value), Parse(m.Groups["minor"].Value), m.Groups["patch"].Success ? Parse(m.Groups["patch"].Value) : 0) is { } fromExe)
|
||||
{
|
||||
return new EngineVersionReading(fromExe, EngineVersionSource.GodotExe);
|
||||
}
|
||||
|
||||
return EngineVersionReading.None;
|
||||
}
|
||||
|
||||
/// <summary><c>4.2.2</c>, <c>4.3</c> — or null for numbers no Godot release carries (a pack written by something else).</summary>
|
||||
private static string? Format(int major, int minor, int patch) =>
|
||||
major is < 1 or > 9 || minor is < 0 or > 99 || patch is < 0 or > 99
|
||||
? null
|
||||
: patch == 0
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}.{patch}");
|
||||
|
||||
private static int Parse(string digits) =>
|
||||
int.TryParse(digits, NumberStyles.None, CultureInfo.InvariantCulture, out int value) ? value : -1;
|
||||
|
||||
[GeneratedRegex(@"^(?<major>\d{1,2})\.(?<minor>\d{1,2})(?:\.(?<patch>\d{1,2}))?(?:\.[a-z]|$)", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex ProductShape();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// What an RPG Maker title's own files say about the maker that built it (beta.19), read from the files on disk.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>MV and MZ</b> ship their engine as JavaScript, and its core script opens with its own name and version — line 2 of
|
||||
/// <c>js/rmmz_core.js</c> reads <c>// rmmz_core.js v1.10.0</c> (A Doll's Locket - Remake), of <c>www/js/rpg_core.js</c>
|
||||
/// <c>// rpg_core.js v1.6.2</c> (Flower in Us, 996IR) or <c>v1.6.1</c> (HELLO, HELLO WORLD!) — measured 2026-10-12.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>XP, VX and VX Ace</b> run on the Ruby Game Scripting System, whose library <c>Game.ini</c> names
|
||||
/// (<c>Library=System\RGSS301.dll</c>): RGSS1 is XP, RGSS2 VX, RGSS3 VX Ace, and the name carries the library's version
|
||||
/// (<c>RGSS301</c> is 3.0.1; its version resource reads <c>3, 0, 1, 1</c> on City of Bones and Träumerei Chapter 2).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed record RpgMakerBuildFacts
|
||||
{
|
||||
/// <summary>The core script whose header was read — <c>rmmz_core.js</c> or <c>rpg_core.js</c> — or null.</summary>
|
||||
public string? CoreScript { get; init; }
|
||||
|
||||
/// <summary>The version that script's header names (<c>1.10.0</c>), or null.</summary>
|
||||
public string? CoreScriptVersion { get; init; }
|
||||
|
||||
/// <summary>The RGSS library's file name (<c>RGSS301.dll</c>), as <c>Game.ini</c> names it or as found, or null.</summary>
|
||||
public string? RgssLibrary { get; init; }
|
||||
|
||||
/// <summary>That library's numeric file version (four parts), or null when it carries none or was not read.</summary>
|
||||
public IReadOnlyList<int>? RgssFileVersion { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// Which RPG Maker built a title, and at which version (beta.19), decided from <see cref="RpgMakerBuildFacts"/> — or nothing.
|
||||
/// The witness names the maker: the App shows <c>rpgmaker_mv</c> as "RPG Maker MZ" when the version came from MZ's core
|
||||
/// script, and <c>rpgmaker_rgss</c> as "RPG Maker VX Ace" when it came from an RGSS3 library.
|
||||
/// </summary>
|
||||
public static partial class RpgMakerVersion
|
||||
{
|
||||
/// <summary>MZ's core script.</summary>
|
||||
public const string MzCoreScript = "rmmz_core.js";
|
||||
|
||||
/// <summary>MV's core script.</summary>
|
||||
public const string MvCoreScript = "rpg_core.js";
|
||||
|
||||
/// <summary>The version these facts establish, and the witness it rests on.</summary>
|
||||
public static EngineVersionReading Decide(RpgMakerBuildFacts facts)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(facts);
|
||||
|
||||
if (ScriptVersion(facts.CoreScriptVersion) is { } script)
|
||||
{
|
||||
if (string.Equals(facts.CoreScript, MzCoreScript, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new EngineVersionReading(script, EngineVersionSource.RpgMakerMzCore);
|
||||
}
|
||||
|
||||
if (string.Equals(facts.CoreScript, MvCoreScript, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new EngineVersionReading(script, EngineVersionSource.RpgMakerMvCore);
|
||||
}
|
||||
}
|
||||
|
||||
if (facts.RgssLibrary is null || LibraryShape().Match(facts.RgssLibrary.Trim()) is not { Success: true } m)
|
||||
{
|
||||
return EngineVersionReading.None;
|
||||
}
|
||||
|
||||
int generation = m.Groups["generation"].Value[0] - '0';
|
||||
string source = generation switch
|
||||
{
|
||||
1 => EngineVersionSource.Rgss1Library,
|
||||
2 => EngineVersionSource.Rgss2Library,
|
||||
_ => EngineVersionSource.Rgss3Library,
|
||||
};
|
||||
|
||||
// The library's own numbers when they are its generation's; else the ones its name carries (RGSS301 → 3.0.1).
|
||||
string version = facts.RgssFileVersion is { Count: >= 3 } parts && parts[0] == generation && parts[1] is >= 0 and <= 9 && parts[2] is >= 0 and <= 9
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{parts[0]}.{parts[1]}.{parts[2]}")
|
||||
: string.Create(CultureInfo.InvariantCulture, $"{generation}.{m.Groups["minor"].Value}.{m.Groups["patch"].Value}");
|
||||
return new EngineVersionReading(version, source);
|
||||
}
|
||||
|
||||
/// <summary>A core script's version as its header writes it (<c>1.10.0</c>), or null when it does not read as one.</summary>
|
||||
public static string? ScriptVersion(string? text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Match m = ScriptShape().Match(text.Trim());
|
||||
return m.Success ? m.Value : null;
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"^\d{1,2}\.\d{1,3}\.\d{1,3}$", RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex ScriptShape();
|
||||
|
||||
[GeneratedRegex(@"^RGSS(?<generation>[123])(?<minor>\d)(?<patch>\d)[A-Z]?\.dll$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex LibraryShape();
|
||||
}
|
||||
@@ -232,8 +232,10 @@ public sealed class RuleEvaluator
|
||||
? v
|
||||
: null,
|
||||
// Not answerable from the snapshot: StaticGameDetector reads the engine's build facts for the one engine
|
||||
// that matched (beta.10) — a scan the probe must not make for every game in the library.
|
||||
VersionExtractorType.UnrealBuild => null,
|
||||
// that matched (beta.10; Unity, Godot and RPG Maker since beta.19) — reads the probe must not make for every
|
||||
// game in the library.
|
||||
VersionExtractorType.UnrealBuild or VersionExtractorType.UnityBuild or VersionExtractorType.GodotBuild
|
||||
or VersionExtractorType.RpgMakerBuild => null,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// What a Unity title's own files say about the engine it was built with (beta.19): read from the files on disk, never from
|
||||
/// the game's process (CLAUDE.md rule 4 is about game memory).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Measured read-only on the owner's fifteen Unity installs, 2026-10-12 (<c>05_DETECTION</c> §Engine version — Unity, Godot,
|
||||
/// RPG Maker): the player library's <c>ProductVersion</c> names the editor version in thirteen
|
||||
/// (<c>2022.3.39f1 (4e1b0f82c39a)</c>); a 2019.4 player carries only numbers there, and its data file's header names it
|
||||
/// (<c>2019.4.1f1</c>); GIRLS' FRONTLINE 2's data file is encrypted, and its player's numeric file version
|
||||
/// (<c>2019.4.40.16762411</c>) is all there is.
|
||||
/// </remarks>
|
||||
public sealed record UnityBuildFacts
|
||||
{
|
||||
/// <summary><c>UnityPlayer.dll</c>'s <c>ProductVersion</c> string, or null.</summary>
|
||||
public string? PlayerProductVersion { get; init; }
|
||||
|
||||
/// <summary><c>UnityPlayer.dll</c>'s numeric file version (four parts), or null when it carries none or was not read.</summary>
|
||||
public IReadOnlyList<int>? PlayerFileVersion { get; init; }
|
||||
|
||||
/// <summary>The editor version the header of <c><Game>_Data\globalgamemanagers</c> names, as read, or null.</summary>
|
||||
public string? DataHeaderVersion { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FrameLedger.Domain.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// The Unity version a title was built with (beta.19, owner request: "detect the version of Unity, Godot and RPG Maker
|
||||
/// games"), decided from <see cref="UnityBuildFacts"/> — or nothing.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>The ladder, strongest first</b> (measured on fifteen installs 2026-10-12):
|
||||
/// </para>
|
||||
/// <list type="number">
|
||||
/// <item>The player library's <c>ProductVersion</c> is an editor version — <c>2022.3.39f1</c>, the release letter and its
|
||||
/// number included (thirteen of fifteen).</item>
|
||||
/// <item>The data file's header names one (A Space for the Unbound: <c>2019.4.1f1</c>, beside a player that carries only
|
||||
/// numbers).</item>
|
||||
/// <item>The player's numeric file version: MAJOR.MINOR.PATCH and no release letter (GIRLS' FRONTLINE 2: <c>2019.4.40</c>,
|
||||
/// whose data file is encrypted). The player library is Unity's own binary — a studio does not number it — so this rung
|
||||
/// is the engine's, only shorter.</item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// Until beta.19 the rules read the player's <c>FileVersion</c> string as it is (<c>2022.3.39.5118735</c>, the build
|
||||
/// number where the release letter belongs).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static partial class UnityVersion
|
||||
{
|
||||
/// <summary>The version these facts establish, and the rung it stands on.</summary>
|
||||
public static EngineVersionReading Decide(UnityBuildFacts facts)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(facts);
|
||||
|
||||
if (EditorVersion(facts.PlayerProductVersion) is { } product)
|
||||
{
|
||||
return new EngineVersionReading(product, EngineVersionSource.UnityPlayer);
|
||||
}
|
||||
|
||||
if (EditorVersion(facts.DataHeaderVersion) is { } header)
|
||||
{
|
||||
return new EngineVersionReading(header, EngineVersionSource.UnityData);
|
||||
}
|
||||
|
||||
return facts.PlayerFileVersion is { Count: >= 3 } parts && IsUnityMajor(parts[0]) && parts[1] is >= 0 and <= 99 && parts[2] is >= 0 and <= 999
|
||||
? new EngineVersionReading(string.Create(CultureInfo.InvariantCulture, $"{parts[0]}.{parts[1]}.{parts[2]}"), EngineVersionSource.UnityPlayerFile)
|
||||
: EngineVersionReading.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The editor version a text starts with — <c>2022.3.39f1</c> of <c>2022.3.39f1 (4e1b0f82c39a)</c>, <c>6000.0.58f2</c> —
|
||||
/// or null when it is not one: a major Unity never used, or no release letter (<c>2019.4.1.15122501</c>).
|
||||
/// </summary>
|
||||
public static string? EditorVersion(string? text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Match m = EditorShape().Match(text.Trim());
|
||||
return m.Success && int.TryParse(m.Groups["major"].Value, NumberStyles.None, CultureInfo.InvariantCulture, out int major) && IsUnityMajor(major)
|
||||
? m.Groups["version"].Value
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The majors Unity has shipped: 3 to 5, the years 2017 to 2023, and Unity 6's <c>6000</c> line (6000.0 is Unity 6,
|
||||
/// 6000.3 is 6.3).
|
||||
/// </summary>
|
||||
private static bool IsUnityMajor(int major) => major is >= 3 and <= 5 or >= 2017 and <= 2023 or >= 6000 and <= 6999;
|
||||
|
||||
[GeneratedRegex(@"^(?<version>(?<major>\d{1,4})\.\d{1,2}\.\d{1,3}[abfpx]\d{1,3})(?![\d.])", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex EditorShape();
|
||||
}
|
||||
@@ -25,4 +25,19 @@ public enum VersionExtractorType
|
||||
/// matched — so <see cref="RuleEvaluator"/> returns null for it.
|
||||
/// </summary>
|
||||
UnrealBuild,
|
||||
|
||||
/// <summary>
|
||||
/// Unity's (beta.19): the player library's version resource and the data file's header, weighed by
|
||||
/// <see cref="UnityVersion.Decide"/>. A second read, like <see cref="UnrealBuild"/>.
|
||||
/// </summary>
|
||||
UnityBuild,
|
||||
|
||||
/// <summary>Godot's (beta.19): a data pack's header and the executable's version resource (<see cref="GodotVersion.Decide"/>).</summary>
|
||||
GodotBuild,
|
||||
|
||||
/// <summary>
|
||||
/// RPG Maker's (beta.19): MV/MZ's core-script header, or the RGSS library <c>Game.ini</c> names
|
||||
/// (<see cref="RpgMakerVersion.Decide"/>).
|
||||
/// </summary>
|
||||
RpgMakerBuild,
|
||||
}
|
||||
@@ -225,6 +225,9 @@ public sealed class DetectionRulesFile : IDetectionRulesSource
|
||||
"strings_regex" => VersionExtractorType.StringsRegex,
|
||||
"manifest_field" => VersionExtractorType.ManifestField,
|
||||
"unreal_build" => VersionExtractorType.UnrealBuild,
|
||||
"unity_build" => VersionExtractorType.UnityBuild,
|
||||
"godot_build" => VersionExtractorType.GodotBuild,
|
||||
"rpgmaker_build" => VersionExtractorType.RpgMakerBuild,
|
||||
_ => throw new InvalidOperationException($"'{owner}' has unknown version extractor '{d.Type}'"),
|
||||
},
|
||||
Value = d.Value,
|
||||
|
||||
@@ -124,6 +124,122 @@ public sealed class GameFileProbe : IGameFileProbe
|
||||
return ValueTask.FromResult(ShippingExecutable(snapshot) is { } exe ? UnrealBuildReader.Read(exe.FullPath, exe.RelativePath, ct) : null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// <c>UnityPlayer.dll</c> beside the row's executable, else the shallowest one the walk listed; the data file is
|
||||
/// <c><exe>_Data\globalgamemanagers</c>, else the one in a <c>*_Data</c> folder beside that player.
|
||||
/// </remarks>
|
||||
public ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(snapshot);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
string exe = Native(snapshot.ExePath);
|
||||
string? exeDirectory = Path.GetDirectoryName(exe);
|
||||
string? beside = exeDirectory is null ? null : Path.Combine(exeDirectory, "UnityPlayer.dll");
|
||||
string? player = beside is not null && File.Exists(beside) ? beside : Shallowest(snapshot, static name => string.Equals(name, "UnityPlayer.dll", StringComparison.OrdinalIgnoreCase));
|
||||
return ValueTask.FromResult(UnityBuildReader.Read(player, UnityDataFile(snapshot, exe, player)));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>The pack is <c><exe>.pck</c> beside the executable, else the only <c>.pck</c> there; else the executable's own end.</remarks>
|
||||
public ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(snapshot);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
string exe = Native(snapshot.ExePath);
|
||||
return ValueTask.FromResult(GodotBuildReader.Read(exe, GodotPack(exe)));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>The core script or <c>Game.ini</c> beside the executable or up to two folders above; else an RGSS library the walk listed.</remarks>
|
||||
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(snapshot);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
string? library = Shallowest(snapshot, static name => name.StartsWith("RGSS", StringComparison.OrdinalIgnoreCase) && name.EndsWith(".dll", StringComparison.OrdinalIgnoreCase));
|
||||
return ValueTask.FromResult(RpgMakerBuildReader.Read(Native(snapshot.ExePath), library));
|
||||
}
|
||||
|
||||
private static string Native(string path) => path.Replace('/', Path.DirectorySeparatorChar);
|
||||
|
||||
/// <summary>The full path of the shallowest file the walk listed whose name <paramref name="named"/> accepts, or null.</summary>
|
||||
private static string? Shallowest(GameFileSnapshot snapshot, Func<string, bool> named)
|
||||
{
|
||||
string? best = null;
|
||||
int bestDepth = int.MaxValue;
|
||||
foreach (string relative in snapshot.RelativeFiles)
|
||||
{
|
||||
int slash = relative.LastIndexOf('/');
|
||||
if (!named(relative[(slash + 1)..]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int depth = relative.Count(static c => c == '/');
|
||||
if (depth < bestDepth)
|
||||
{
|
||||
(best, bestDepth) = (relative, depth);
|
||||
}
|
||||
}
|
||||
|
||||
return best is null ? null : Native(snapshot.GameDirectory.TrimEnd('/') + "/" + best);
|
||||
}
|
||||
|
||||
private static string? UnityDataFile(GameFileSnapshot snapshot, string exe, string? player)
|
||||
{
|
||||
string? exeDirectory = Path.GetDirectoryName(exe);
|
||||
if (exeDirectory is not null)
|
||||
{
|
||||
string own = Path.Combine(exeDirectory, Path.GetFileNameWithoutExtension(exe) + "_Data", "globalgamemanagers");
|
||||
if (File.Exists(own))
|
||||
{
|
||||
return own;
|
||||
}
|
||||
}
|
||||
|
||||
string? playerDirectory = player is null ? null : Path.GetDirectoryName(player);
|
||||
if (playerDirectory is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return Directory.EnumerateDirectories(playerDirectory, "*_Data")
|
||||
.Select(static d => Path.Combine(d, "globalgamemanagers"))
|
||||
.FirstOrDefault(File.Exists);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static string? GodotPack(string exe)
|
||||
{
|
||||
string? directory = Path.GetDirectoryName(exe);
|
||||
if (directory is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string own = Path.Combine(directory, Path.GetFileNameWithoutExtension(exe) + ".pck");
|
||||
if (File.Exists(own))
|
||||
{
|
||||
return own;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string[] packs = [.. Directory.EnumerateFiles(directory, "*.pck").Take(2)];
|
||||
return packs.Length == 1 ? packs[0] : null;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The executable an Unreal title's engine version is read from (beta.10): the row's own when it is the shipping build
|
||||
/// (<c>*-Win64-Shipping.exe</c>, <c>*-WinGDK-Shipping.exe</c> — what <c>ExecutableLocator</c> prefers), else the largest
|
||||
@@ -303,9 +419,9 @@ public sealed class GameFileProbe : IGameFileProbe
|
||||
/// name, keyed by the <c>from</c> value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Unity's rule reads <c>UnityPlayer.dll</c>. Answering that from the game
|
||||
/// executable would report a version that is <em>wrong</em> rather than
|
||||
/// merely missing, which is the worse of the two failures.
|
||||
/// CryEngine's rule reads <c>CrySystem.dll</c> (Unity's read <c>UnityPlayer.dll</c> until beta.19, when its version
|
||||
/// became <see cref="ReadUnityBuildAsync"/>'s). Answering that from the game executable would report a version that is
|
||||
/// <em>wrong</em> rather than merely missing, which is the worse of the two failures.
|
||||
/// </remarks>
|
||||
private static Dictionary<string, string> ReadSiblingVersions(string dir, DetectionRuleSet rules)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Buffers.Binary;
|
||||
using System.Diagnostics;
|
||||
using FrameLedger.Domain.Detection;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// Godot's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker): the
|
||||
/// 20-byte header of the data pack — <c>GDPC</c>, the pack format, the engine's MAJOR, MINOR and PATCH, little-endian — from
|
||||
/// a <c>.pck</c> beside the executable, or from a pack appended to the executable, which ends with the pack's size and the
|
||||
/// magic again; and the executable's version resource. Nothing else of either file is read.
|
||||
/// </summary>
|
||||
public static class GodotBuildReader
|
||||
{
|
||||
/// <summary><c>GDPC</c> as the little-endian <c>uint</c> a pack starts (and an appended pack ends) with.</summary>
|
||||
public const uint PackMagic = 0x43504447;
|
||||
|
||||
/// <summary>The header: magic, format, major, minor, patch.</summary>
|
||||
public const int HeaderBytes = 20;
|
||||
|
||||
/// <summary>What an appended pack leaves at the end of the executable: its size (a 64-bit integer), then the magic.</summary>
|
||||
public const int TrailerBytes = 12;
|
||||
|
||||
/// <summary>The facts for <paramref name="exePath"/>, or null when nothing could be read.</summary>
|
||||
/// <param name="exePath">The game's executable.</param>
|
||||
/// <param name="packPath">The <c>.pck</c> beside it, or null when there is none.</param>
|
||||
public static GodotBuildFacts? Read(string exePath, string? packPath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
|
||||
IReadOnlyList<int>? pack = packPath is null ? null : ReadFile(packPath, static s => ReadHeader(s, 0));
|
||||
bool embedded = false;
|
||||
if (pack is null)
|
||||
{
|
||||
pack = ReadFile(exePath, ReadAppended);
|
||||
embedded = pack is not null;
|
||||
}
|
||||
|
||||
string? productName = null;
|
||||
string? productVersion = null;
|
||||
try
|
||||
{
|
||||
FileVersionInfo info = FileVersionInfo.GetVersionInfo(exePath);
|
||||
productName = string.IsNullOrWhiteSpace(info.ProductName) ? null : info.ProductName.Trim();
|
||||
productVersion = string.IsNullOrWhiteSpace(info.ProductVersion) ? null : info.ProductVersion.Trim();
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
|
||||
{
|
||||
// The pack, if read, is the stronger witness anyway.
|
||||
}
|
||||
|
||||
return pack is null && productName is null && productVersion is null
|
||||
? null
|
||||
: new GodotBuildFacts { PackVersion = pack, PackEmbedded = embedded, ExeProductName = productName, ExeProductVersion = productVersion };
|
||||
}
|
||||
|
||||
/// <summary>MAJOR, MINOR, PATCH from a header at <paramref name="offset"/>, or null when there is none. Public for the tests.</summary>
|
||||
public static IReadOnlyList<int>? ReadHeader(Stream stream, long offset)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(stream);
|
||||
if (offset < 0 || offset + HeaderBytes > stream.Length)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Span<byte> header = stackalloc byte[HeaderBytes];
|
||||
stream.Position = offset;
|
||||
if (stream.ReadAtLeast(header, HeaderBytes, throwOnEndOfStream: false) < HeaderBytes
|
||||
|| BinaryPrimitives.ReadUInt32LittleEndian(header) != PackMagic)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
uint major = BinaryPrimitives.ReadUInt32LittleEndian(header[8..]);
|
||||
uint minor = BinaryPrimitives.ReadUInt32LittleEndian(header[12..]);
|
||||
uint patch = BinaryPrimitives.ReadUInt32LittleEndian(header[16..]);
|
||||
return major > 99 || minor > 99 || patch > 99 ? null : [(int)major, (int)minor, (int)patch];
|
||||
}
|
||||
|
||||
/// <summary>The header of a pack appended to an executable, found through the trailer it ends with. Public for the tests.</summary>
|
||||
public static IReadOnlyList<int>? ReadAppended(Stream stream)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(stream);
|
||||
long length = stream.Length;
|
||||
if (length < TrailerBytes + HeaderBytes)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Span<byte> trailer = stackalloc byte[TrailerBytes];
|
||||
stream.Position = length - TrailerBytes;
|
||||
if (stream.ReadAtLeast(trailer, TrailerBytes, throwOnEndOfStream: false) < TrailerBytes
|
||||
|| BinaryPrimitives.ReadUInt32LittleEndian(trailer[8..]) != PackMagic)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
long size = BinaryPrimitives.ReadInt64LittleEndian(trailer);
|
||||
return size < HeaderBytes || size > length - TrailerBytes ? null : ReadHeader(stream, length - TrailerBytes - size);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<int>? ReadFile(string path, Func<Stream, IReadOnlyList<int>?> read)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
|
||||
return read(file);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using FrameLedger.Domain.Detection;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// RPG Maker's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker):
|
||||
/// the first <see cref="ScriptHeaderBytes"/> of MV/MZ's core script (<c>js/rmmz_core.js</c>, <c>www/js/rpg_core.js</c>,
|
||||
/// <c>js/rpg_core.js</c>), or <c>Game.ini</c>'s <c>Library=</c> line and that RGSS library's version resource — beside the
|
||||
/// executable or up to two folders above it, as <c>RpgMakerTitle</c> looks (a launcher-fronted game keeps its runtime in a
|
||||
/// subfolder: HELLO, HELLO WORLD!'s is <c>swiftshader\</c>, A Doll's Locket's <c>css\</c>). Nothing else is read.
|
||||
/// </summary>
|
||||
public static partial class RpgMakerBuildReader
|
||||
{
|
||||
/// <summary>How much of a core script is read: its opening comment block, with room to spare (the version is on line 2).</summary>
|
||||
public const int ScriptHeaderBytes = 4096;
|
||||
|
||||
/// <summary>A <c>Game.ini</c> larger than this is not RPG Maker's (it holds four short lines).</summary>
|
||||
public const long MaxIniBytes = 64 * 1024;
|
||||
|
||||
/// <summary>How many folders above the executable's own are looked in.</summary>
|
||||
public const int FoldersUp = 2;
|
||||
|
||||
private static readonly (string Relative, string Script)[] _scripts =
|
||||
[
|
||||
(Path.Combine("js", RpgMakerVersion.MzCoreScript), RpgMakerVersion.MzCoreScript),
|
||||
(Path.Combine("www", "js", RpgMakerVersion.MvCoreScript), RpgMakerVersion.MvCoreScript),
|
||||
(Path.Combine("js", RpgMakerVersion.MvCoreScript), RpgMakerVersion.MvCoreScript),
|
||||
];
|
||||
|
||||
/// <summary>The facts for an entry at <paramref name="exePath"/>, or null when none of the files is there.</summary>
|
||||
/// <param name="exePath">The entry's executable.</param>
|
||||
/// <param name="rgssLibrary">An RGSS library the install listing holds, for an install with no readable <c>Game.ini</c>; or null.</param>
|
||||
public static RpgMakerBuildFacts? Read(string exePath, string? rgssLibrary = null)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
|
||||
string? folder = Path.GetDirectoryName(exePath);
|
||||
for (int up = 0; up <= FoldersUp && !string.IsNullOrEmpty(folder); up++, folder = Path.GetDirectoryName(folder))
|
||||
{
|
||||
foreach ((string relative, string script) in _scripts)
|
||||
{
|
||||
if (ScriptVersion(Path.Combine(folder, relative), script) is { } version)
|
||||
{
|
||||
return new RpgMakerBuildFacts { CoreScript = script, CoreScriptVersion = version };
|
||||
}
|
||||
}
|
||||
|
||||
if (LibraryOf(Path.Combine(folder, "Game.ini")) is { } library)
|
||||
{
|
||||
return Rgss(library);
|
||||
}
|
||||
}
|
||||
|
||||
return rgssLibrary is null ? null : Rgss(rgssLibrary);
|
||||
}
|
||||
|
||||
/// <summary>The version a core script's header names for <paramref name="script"/>, or null. Public for the tests.</summary>
|
||||
public static string? ScriptVersion(string path, string script)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(path);
|
||||
try
|
||||
{
|
||||
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
|
||||
byte[] head = new byte[ScriptHeaderBytes];
|
||||
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
|
||||
foreach (Match m in HeaderLine().Matches(Encoding.UTF8.GetString(head, 0, read)))
|
||||
{
|
||||
if (string.Equals(m.Groups["script"].Value, script, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return RpgMakerVersion.ScriptVersion(m.Groups["version"].Value);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The library a <c>Game.ini</c> names (<c>Library=System\RGSS301.dll</c>), as a full path under the ini's folder — or
|
||||
/// its bare file name when the value points outside that folder, which is then not read. Null without the line.
|
||||
/// </summary>
|
||||
public static string? LibraryOf(string iniPath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(iniPath);
|
||||
try
|
||||
{
|
||||
var ini = new FileInfo(iniPath);
|
||||
if (!ini.Exists || ini.Length > MaxIniBytes || ini.DirectoryName is not { } folder)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (string line in File.ReadLines(iniPath, Encoding.Latin1))
|
||||
{
|
||||
Match m = LibraryLine().Match(line);
|
||||
if (!m.Success)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string value = m.Groups["value"].Value.Trim();
|
||||
string full = Path.GetFullPath(Path.Combine(folder, value));
|
||||
return full.StartsWith(Path.TrimEndingDirectorySeparator(folder) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)
|
||||
? full
|
||||
: Path.GetFileName(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static RpgMakerBuildFacts Rgss(string library)
|
||||
{
|
||||
IReadOnlyList<int>? version = null;
|
||||
if (Path.IsPathFullyQualified(library))
|
||||
{
|
||||
try
|
||||
{
|
||||
FileVersionInfo info = FileVersionInfo.GetVersionInfo(library);
|
||||
version = info.FileMajorPart == 0 && info.FileMinorPart == 0 && info.FileBuildPart == 0 && info.FilePrivatePart == 0
|
||||
? null
|
||||
: [info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart];
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
|
||||
{
|
||||
// The name still carries the version (RGSS301 is 3.0.1).
|
||||
}
|
||||
}
|
||||
|
||||
return new RpgMakerBuildFacts { RgssLibrary = Path.GetFileName(library), RgssFileVersion = version };
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"^//\s*(?<script>rmmz_core\.js|rpg_core\.js)\s+v(?<version>\d{1,2}\.\d{1,3}\.\d{1,3})\b", RegexOptions.ExplicitCapture | RegexOptions.Multiline | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex HeaderLine();
|
||||
|
||||
[GeneratedRegex(@"^\s*Library\s*=\s*(?<value>\S.*)$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex LibraryLine();
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using FrameLedger.Domain.Detection;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Detection;
|
||||
|
||||
/// <summary>
|
||||
/// Unity's build facts from the files on disk (beta.19, <c>05_DETECTION</c> §Engine version — Unity, Godot, RPG Maker): the
|
||||
/// player library's version resource and the first <see cref="DataHeaderBytes"/> bytes of the data file
|
||||
/// <c>globalgamemanagers</c>, whose serialized-file header names the editor version (at byte 20 in a 2019.4 build, 48 in
|
||||
/// later ones). Nothing else of either file is read; the game's process is never opened.
|
||||
/// </summary>
|
||||
public static partial class UnityBuildReader
|
||||
{
|
||||
/// <summary>How much of the data file is read: its header, with room to spare (the version sat at 48 at the latest).</summary>
|
||||
public const int DataHeaderBytes = 256;
|
||||
|
||||
/// <summary>The facts in the two files, or null when neither gave any.</summary>
|
||||
/// <param name="playerPath"><c>UnityPlayer.dll</c>, or null when the install has none.</param>
|
||||
/// <param name="dataFilePath"><c><Game>_Data\globalgamemanagers</c>, or null.</param>
|
||||
public static UnityBuildFacts? Read(string? playerPath, string? dataFilePath)
|
||||
{
|
||||
string? product = null;
|
||||
IReadOnlyList<int>? numeric = null;
|
||||
if (playerPath is not null)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileVersionInfo info = FileVersionInfo.GetVersionInfo(playerPath);
|
||||
product = string.IsNullOrWhiteSpace(info.ProductVersion) ? null : info.ProductVersion.Trim();
|
||||
numeric = info.FileMajorPart == 0 && info.FileMinorPart == 0 && info.FileBuildPart == 0 && info.FilePrivatePart == 0
|
||||
? null
|
||||
: [info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart];
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
|
||||
{
|
||||
// No version resource read: the data file may still say it.
|
||||
}
|
||||
}
|
||||
|
||||
string? header = dataFilePath is null ? null : DataHeaderVersion(dataFilePath);
|
||||
return product is null && numeric is null && header is null
|
||||
? null
|
||||
: new UnityBuildFacts { PlayerProductVersion = product, PlayerFileVersion = numeric, DataHeaderVersion = header };
|
||||
}
|
||||
|
||||
/// <summary>The editor version in the first <see cref="DataHeaderBytes"/> of a data file, or null. Public for the tests.</summary>
|
||||
public static string? DataHeaderVersion(string dataFilePath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(dataFilePath);
|
||||
try
|
||||
{
|
||||
using var file = new FileStream(dataFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
|
||||
byte[] head = new byte[DataHeaderBytes];
|
||||
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
|
||||
Match m = HeaderVersion().Match(Encoding.Latin1.GetString(head, 0, read));
|
||||
return m.Success ? UnityVersion.EditorVersion(m.Value) : null;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"\d{1,4}\.\d{1,2}\.\d{1,3}[abfpx]\d{1,3}", RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
|
||||
private static partial Regex HeaderVersion();
|
||||
}
|
||||
@@ -24,9 +24,14 @@ namespace FrameLedger.Infrastructure.Import;
|
||||
/// bootstrapper and as <c>Game-Win64-Shipping.exe</c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The two layout rules are the engines' own conventions, not guesses about names: a Unity player is <c>X.exe</c>
|
||||
/// beside a directory <c>X_Data</c>, and an Unreal packaged build's game process is <c>*-Win64-Shipping.exe</c> (the
|
||||
/// root executable of the same name is a bootstrapper that starts it and exits).
|
||||
/// The layout rules are the engines' own conventions, not guesses about names: a Unity player is <c>X.exe</c> beside a
|
||||
/// directory <c>X_Data</c>, an Unreal packaged build's game process is <c>*-Win64-Shipping.exe</c> (the root executable
|
||||
/// of the same name is a bootstrapper that starts it and exits), and — since beta.19 (owner decision D56) — an NW.js
|
||||
/// runtime is the executable beside its <c>nw.dll</c> and <c>package.json</c>, which is how an RPG Maker MV/MZ game
|
||||
/// ships. The last one ranks below the first two and above a name: an NW.js folder can be a tool shipped beside a Unity
|
||||
/// or Unreal game, and a launcher named after the install is exactly what fronts the runtime on A Doll's Locket - Remake
|
||||
/// (itch), whose 213 MB <c>DollsLocket.exe</c> starts <c>css\Game.exe</c> — the process that draws, the one D28 pointed
|
||||
/// HELLO, HELLO WORLD!'s entry at by hand.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class ExecutableLocator : IExecutableLocator
|
||||
@@ -37,7 +42,8 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
/// </summary>
|
||||
public const int MaxDepth = 4;
|
||||
|
||||
private const int _rankEngineLayout = 2;
|
||||
private const int _rankEngineLayout = 3;
|
||||
private const int _rankNwjsRuntime = 2;
|
||||
private const int _rankNamedAfterTheInstall = 1;
|
||||
private const int _minimumNameLength = 4;
|
||||
|
||||
@@ -50,8 +56,30 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
// beta.14: BugSplat's sender (BsSndRpt64.exe, Kingdom Come: Deliverance II) matches none of the above — its name says
|
||||
// "report" without the letters; KCD2 picked its game by rank alone.
|
||||
"bssndrpt", "bugsplat",
|
||||
// beta.19: what an NW.js runtime keeps beside itself — Chromium's toast helper (NW.js 0.48.4 on A Doll's Locket - Remake,
|
||||
// 0.82.0 on Flower in Us), and the SDK flavour's compiler and driver, which the NW.js rank would otherwise weigh as the game.
|
||||
"notification_helper", "nwjc", "chromedriver",
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Whole names (no extension) of helpers a runtime ships beside a game, which no store's choice makes the game (beta.19).
|
||||
/// itch's butler keeps the shallowest candidates and drops those that ask for elevation, so its verdict for A Doll's
|
||||
/// Locket - Remake named <c>notification_helper.exe</c> and nothing else. Whole names rather than
|
||||
/// <see cref="HelperFragments"/>: a store names its own pick, and a fragment such as <c>node</c> is inside a real game's
|
||||
/// name (<c>Nodebuster</c>) — the locator's guess can afford that, overruling a store's verdict cannot.
|
||||
/// </summary>
|
||||
public static readonly IReadOnlySet<string> RuntimeHelperNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"notification_helper", "crashpad_handler", "UnityCrashHandler64", "UnityCrashHandler32", "CrashReportClient", "nwjc", "chromedriver",
|
||||
};
|
||||
|
||||
/// <summary>True for a name in <see cref="RuntimeHelperNames"/>.</summary>
|
||||
public static bool IsRuntimeHelper(string fileNameWithoutExtension)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(fileNameWithoutExtension);
|
||||
return RuntimeHelperNames.Contains(fileNameWithoutExtension);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Folder-name fragments of what a store install carries beside the game: a folder whose name holds one is not walked.
|
||||
/// Red Dead Redemption 2's <c>Redistributables\Rockstar-Games-Launcher.exe</c> is 140 MB to <c>RDR2.exe</c>'s 90.
|
||||
@@ -164,6 +192,11 @@ public sealed class ExecutableLocator : IExecutableLocator
|
||||
return _rankEngineLayout; // Unreal: the packaged game process, not the root bootstrapper
|
||||
}
|
||||
|
||||
if (dir is not null && File.Exists(Path.Combine(dir, "nw.dll")) && File.Exists(Path.Combine(dir, "package.json")))
|
||||
{
|
||||
return _rankNwjsRuntime; // NW.js (RPG Maker MV/MZ): the runtime, not the launcher in front of it (D56)
|
||||
}
|
||||
|
||||
string squashed = Squash(name);
|
||||
bool named = squashed.Length >= _minimumNameLength && installName.Length >= _minimumNameLength
|
||||
&& (installName.Contains(squashed, StringComparison.Ordinal) || squashed.Contains(installName, StringComparison.Ordinal));
|
||||
|
||||
@@ -99,16 +99,7 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
""", cancellationToken: ct)).ConfigureAwait(false)).Select(static r => new CaveRow(r.GameId, r.LocationPath, r.FolderName, r.CustomFolder, r.Verdict, r.Title))];
|
||||
}
|
||||
|
||||
int added = 0;
|
||||
foreach (CaveRow cave in caves)
|
||||
{
|
||||
if (ToGame(cave) is { } game && byInstall.TryAdd(game.InstallDirectory, game))
|
||||
{
|
||||
added++;
|
||||
}
|
||||
}
|
||||
|
||||
return $"butler.db read: {locations} location(s), {caves.Count} cave(s), {added} title(s)";
|
||||
return AddCaves(locations, caves, byInstall);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or SqliteException or InvalidOperationException)
|
||||
{
|
||||
@@ -126,7 +117,26 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
}
|
||||
}
|
||||
|
||||
private static StoreGame? ToGame(CaveRow cave)
|
||||
/// <summary>One row per cave the database lists; returns the log fragment — with the titles whose verdict named only a helper.</summary>
|
||||
private static string AddCaves(int locations, List<CaveRow> caves, Dictionary<string, StoreGame> byInstall)
|
||||
{
|
||||
int added = 0;
|
||||
List<string> helperVerdicts = [];
|
||||
foreach (CaveRow cave in caves)
|
||||
{
|
||||
if (ToGame(cave, helperVerdicts) is { } game && byInstall.TryAdd(game.InstallDirectory, game))
|
||||
{
|
||||
added++;
|
||||
}
|
||||
}
|
||||
|
||||
string note = $"butler.db read: {locations} location(s), {caves.Count} cave(s), {added} title(s)";
|
||||
return helperVerdicts.Count == 0
|
||||
? note
|
||||
: note + $"; butler's verdict named only a helper for {string.Join(", ", helperVerdicts)} — the executable is guessed instead";
|
||||
}
|
||||
|
||||
private static StoreGame? ToGame(CaveRow cave, List<string> helperVerdicts)
|
||||
{
|
||||
string? install = !string.IsNullOrWhiteSpace(cave.CustomFolder) ? cave.CustomFolder
|
||||
: cave.LocationPath is { Length: > 0 } && cave.FolderName is { Length: > 0 } ? Path.Combine(cave.LocationPath, cave.FolderName)
|
||||
@@ -138,7 +148,13 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
|
||||
install = Path.GetFullPath(install);
|
||||
string name = cave.Title is { Length: > 0 } ? cave.Title : ReadReceipt(Path.Combine(install, ".itch", "receipt.json.gz"))?.Title ?? Path.GetFileName(install);
|
||||
return new StoreGame(_platform, cave.GameId.ToString(System.Globalization.CultureInfo.InvariantCulture), name, install, VerdictExecutable(cave.Verdict, install), Version: null);
|
||||
string? exe = VerdictExecutable(cave.Verdict, install, out bool onlyHelpers);
|
||||
if (onlyHelpers)
|
||||
{
|
||||
helperVerdicts.Add(name);
|
||||
}
|
||||
|
||||
return new StoreGame(_platform, cave.GameId.ToString(System.Globalization.CultureInfo.InvariantCulture), name, install, exe, Version: null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -146,8 +162,17 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
/// Windows candidate is the executable butler itself launches; anything else (an HTML5 or Love2D game, a
|
||||
/// verdict that will not parse) leaves the guess to the locator.
|
||||
/// </summary>
|
||||
private static string? VerdictExecutable(string? verdict, string install)
|
||||
/// <remarks>
|
||||
/// <b>Not a candidate a runtime ships as a helper (beta.19).</b> butler saves a FILTERED verdict — the shallowest
|
||||
/// candidates, minus those whose manifest asks for elevation — and does not rank what is left, so on A Doll's Locket -
|
||||
/// Remake (game 5085165) the one candidate was <c>Dolls Locket/notification_helper.exe</c>: the 213 MB launcher asks for
|
||||
/// administrator and the NW.js runtime sits a level deeper. The import took it as the game, unmarked as a guess. A
|
||||
/// candidate <see cref="ExecutableLocator.IsRuntimeHelper"/> names, or one inside a Unity plugin folder, is skipped;
|
||||
/// when nothing else is left, <paramref name="onlyHelpers"/> is true and the locator guesses — the review says so.
|
||||
/// </remarks>
|
||||
private static string? VerdictExecutable(string? verdict, string install, out bool onlyHelpers)
|
||||
{
|
||||
onlyHelpers = false;
|
||||
if (string.IsNullOrWhiteSpace(verdict))
|
||||
{
|
||||
return null;
|
||||
@@ -167,7 +192,15 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
&& string.Equals(flavor.GetString(), "windows", StringComparison.Ordinal);
|
||||
if (windows && candidate.TryGetProperty("path", out JsonElement path) && path.ValueKind == JsonValueKind.String && path.GetString() is { Length: > 0 } relative)
|
||||
{
|
||||
return Path.GetFullPath(Path.Combine(install, relative.Replace('/', Path.DirectorySeparatorChar)));
|
||||
string full = Path.GetFullPath(Path.Combine(install, relative.Replace('/', Path.DirectorySeparatorChar)));
|
||||
if (ExecutableLocator.IsRuntimeHelper(Path.GetFileNameWithoutExtension(full)) || ExecutableLocator.IsUnderPluginFolder(install, full))
|
||||
{
|
||||
onlyHelpers = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
onlyHelpers = false;
|
||||
return full;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +208,7 @@ public sealed class ItchLibrarySource(string? itchDirectory = null, Action<strin
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
onlyHelpers = false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -76,6 +76,7 @@ public static class Strings
|
||||
nameof(Safety_Refused_Unnamed),
|
||||
nameof(Safety_Unhooked_Format),
|
||||
nameof(Safety_Unhooked_MachineWide_Format),
|
||||
nameof(Safety_Unhooked_Unnamed_Format),
|
||||
];
|
||||
|
||||
public static string Safety_AdminMode_Accept => ResourceManager.GetString(nameof(Safety_AdminMode_Accept), Culture) ?? nameof(Safety_AdminMode_Accept);
|
||||
@@ -171,4 +172,6 @@ public static class Strings
|
||||
public static string Safety_Unhooked_Format => ResourceManager.GetString(nameof(Safety_Unhooked_Format), Culture) ?? nameof(Safety_Unhooked_Format);
|
||||
|
||||
public static string Safety_Unhooked_MachineWide_Format => ResourceManager.GetString(nameof(Safety_Unhooked_MachineWide_Format), Culture) ?? nameof(Safety_Unhooked_MachineWide_Format);
|
||||
|
||||
public static string Safety_Unhooked_Unnamed_Format => ResourceManager.GetString(nameof(Safety_Unhooked_Unnamed_Format), Culture) ?? nameof(Safety_Unhooked_Unnamed_Format);
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Capture stopped while the game was running — {0} — and FrameLedger unhooked.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value><comment>safety: human review required</comment></data>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking has been turned off for this game; its page says what was found.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Capture stopped: {0} was detected while the game was running, and FrameLedger unhooked.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Capture stopped: {0} started on this PC while the game was running ({1}) — a driver or service, which may belong to another game or program — and FrameLedger unhooked. The game's next session is measured again once it is no longer running.</value></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Capture stopped while the game was running — {0} — and FrameLedger unhooked.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>The game is running, but Windows would not let FrameLedger open its process: it is protected by an anti-cheat driver, or it runs as administrator while FrameLedger does not. Nothing was injected and this run was not measured. FrameLedger will not work around another product's protection. If the game itself runs as administrator, the agent's admin mode in Settings lets FrameLedger open it; a protected process stays closed.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Make a user-mode exception for {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger found {0} in this game ({1}) and turned its hooking off. This dialog asks whether to make an exception for this game only. It recommends neither choice.</value></data>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<data name="Safety_HookingTurnedOff" xml:space="preserve"><value>Hooking đã được tắt cho game này; trang của game ghi rõ đã phát hiện gì.</value></data>
|
||||
<data name="Safety_Unhooked_Format" xml:space="preserve"><value>Đã dừng thu thập: phát hiện {0} khi game đang chạy, và FrameLedger đã gỡ hook.</value></data>
|
||||
<data name="Safety_Unhooked_MachineWide_Format" xml:space="preserve"><value>Đã dừng thu thập: {0} khởi động trên máy này khi game đang chạy ({1}) — một driver hoặc service, có thể thuộc về game hay chương trình khác — và FrameLedger đã gỡ hook. Phiên sau của game sẽ được đo lại khi nó không còn chạy.</value></data>
|
||||
<data name="Safety_Unhooked_Unnamed_Format" xml:space="preserve"><value>Đã dừng thu thập khi game đang chạy — {0} — và FrameLedger đã gỡ hook.</value></data>
|
||||
<data name="Safety_Refused_TargetUnreadable" xml:space="preserve"><value>Game đang chạy, nhưng Windows không cho FrameLedger mở tiến trình của nó: tiến trình được driver anti-cheat bảo vệ, hoặc game chạy với quyền quản trị còn FrameLedger thì không. Không có gì được inject và lần chạy này không được đo. FrameLedger sẽ không tìm cách vượt qua cơ chế bảo vệ của sản phẩm khác. Nếu chính game chạy với quyền quản trị, chế độ quản trị của agent trong Cài đặt cho phép FrameLedger mở nó; tiến trình được bảo vệ vẫn đóng.</value></data>
|
||||
<data name="Safety_Exception_Title_Format" xml:space="preserve"><value>Tạo ngoại lệ user-mode cho {0}?</value></data>
|
||||
<data name="Safety_Exception_Intro_Format" xml:space="preserve"><value>FrameLedger đã phát hiện {0} trong game này ({1}) và đã tắt hooking cho nó. Hộp thoại này hỏi bạn có muốn tạo ngoại lệ cho riêng game này không. Nó không khuyến nghị lựa chọn nào.</value></data>
|
||||
|
||||
@@ -22,40 +22,60 @@ target_compile_features(FrameLedger.Shm INTERFACE cxx_std_20)
|
||||
#
|
||||
# KNOWN LIMIT, stated rather than discovered: this runs at CONFIGURE time, so the
|
||||
# `-dirty` suffix reflects the tree when CMake last ran, not when the DLL was
|
||||
# last compiled. For a released build that is exact — CI configures and builds
|
||||
# once from a clean checkout. For a developer editing between configures it is
|
||||
# approximate, and the field is a version-skew signal rather than a provenance
|
||||
# guarantee. Making it exact means re-running git on every build, which is a cost
|
||||
# on every incremental compile for a value only the attach handshake reads.
|
||||
execute_process(
|
||||
COMMAND git describe --always --dirty --abbrev=12
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE FL_BUILD_ID_RAW
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(NOT FL_BUILD_ID_RAW)
|
||||
set(FL_BUILD_ID_RAW "unknown")
|
||||
endif()
|
||||
# buildId is char[32] and the guard side compares the whole array, so a value
|
||||
# that would be truncated must be caught here rather than becoming a permanent
|
||||
# mismatch nobody can explain.
|
||||
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
|
||||
# AFTER THE FIRST TAG the long form stopped fitting on a developer's machine: `v0.1.0-beta.2-2-gd3e74988a7bc-dirty`
|
||||
# is 35 characters, so every local configure with an uncommitted change failed here and the documented workaround
|
||||
# was "commit before you build" (measured 2026-09-17, again 2026-09-21). The id is a version-skew signal, not a
|
||||
# provenance guarantee (above), so the fallback spends fewer characters on the same facts: an 8-digit abbreviation
|
||||
# and `+` for dirty. A released build is a clean checkout AT a tag and never reaches this branch. Still too long
|
||||
# after that is still fatal, for the reason the check exists.
|
||||
if(FL_BUILD_ID_LEN GREATER 31)
|
||||
# last compiled. This comment said that for a released build it was exact, "CI
|
||||
# configures and builds once from a clean checkout", and it was not (corrected
|
||||
# 2026-10-07, beta.18): release.yml writes the release date into the tracked
|
||||
# legal/*.md before the gate configures, and every release until beta.18 shipped
|
||||
# "<tag>-dirty" — the owner's Dashboard read "Overlay build v0.1.0-beta.17-dirty",
|
||||
# and the run's log "FL_BUILD_ID = v0.1.0-beta.17-dirty" two lines after
|
||||
# "RELEASE_DATE = 2026-10-07 in 3 file(s)". A release now hands the id in (below). For a
|
||||
# developer editing between configures it is approximate, and the field is a
|
||||
# version-skew signal rather than a provenance guarantee. Making it exact means
|
||||
# re-running git on every build, which is a cost on every incremental compile for a
|
||||
# value only the attach handshake reads.
|
||||
#
|
||||
# A RELEASE HANDS THE ID IN: release.yml reads describe from the clean checkout, before
|
||||
# anything edits a tracked file, and passes it as the environment's FL_BUILD_ID; it is
|
||||
# taken as given here, and tools/buildid-check.ps1 then reads it back out of the
|
||||
# published binaries. It goes into a C string literal, so it must be what describe can
|
||||
# print and nothing a literal would have to escape.
|
||||
if(DEFINED ENV{FL_BUILD_ID} AND NOT "$ENV{FL_BUILD_ID}" STREQUAL "")
|
||||
set(FL_BUILD_ID_RAW "$ENV{FL_BUILD_ID}")
|
||||
if(NOT FL_BUILD_ID_RAW MATCHES "^[0-9A-Za-z._+-]+$")
|
||||
message(FATAL_ERROR "FL_BUILD_ID '${FL_BUILD_ID_RAW}' from the environment holds a character no build id has (0-9 A-Z a-z . _ + -).")
|
||||
endif()
|
||||
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND git describe --always --dirty=+ --abbrev=8
|
||||
COMMAND git describe --always --dirty --abbrev=12
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE FL_BUILD_ID_RAW
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(NOT FL_BUILD_ID_RAW)
|
||||
set(FL_BUILD_ID_RAW "unknown")
|
||||
endif()
|
||||
# buildId is char[32] and the guard side compares the whole array, so a value
|
||||
# that would be truncated must be caught here rather than becoming a permanent
|
||||
# mismatch nobody can explain.
|
||||
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
|
||||
# AFTER THE FIRST TAG the long form stopped fitting on a developer's machine: `v0.1.0-beta.2-2-gd3e74988a7bc-dirty`
|
||||
# is 35 characters, so every local configure with an uncommitted change failed here and the documented workaround
|
||||
# was "commit before you build" (measured 2026-09-17, again 2026-09-21). The id is a version-skew signal, not a
|
||||
# provenance guarantee (above), so the fallback spends fewer characters on the same facts: an 8-digit abbreviation
|
||||
# and `+` for dirty. A released build hands its id in (above) and never reaches this branch. Still too long
|
||||
# after that is still fatal, for the reason the check exists.
|
||||
if(FL_BUILD_ID_LEN GREATER 31)
|
||||
execute_process(
|
||||
COMMAND git describe --always --dirty=+ --abbrev=8
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE FL_BUILD_ID_RAW
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
string(LENGTH "${FL_BUILD_ID_RAW}" FL_BUILD_ID_LEN)
|
||||
endif()
|
||||
endif()
|
||||
if(FL_BUILD_ID_LEN GREATER 31)
|
||||
message(FATAL_ERROR
|
||||
|
||||
@@ -185,6 +185,24 @@ public sealed class AccessibilityTests
|
||||
wrapped.Should().BeEmpty("a page without ScrollViewer.CanContentScroll=\"False\" is wrapped in WPF UI's scroller, and its own root swallows the wheel");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.18 (the owner's screenshots of beta.17 in the dark theme: every page's title near-black on the dark window). A
|
||||
/// page is shown in WPF UI's <c>NavigationViewContentPresenter</c>, a <c>Frame</c>, and a Frame sets
|
||||
/// <c>InheritanceBehavior.SkipToAppNow</c>: the window's text colour never reaches the page, and a text with no colour
|
||||
/// of its own is WPF UI's TextBlock default, black. Every page gives its texts the theme's colour itself.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EveryPageSetsItsOwnTextColour()
|
||||
{
|
||||
List<string> pages = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)).Select(static x => x.File)];
|
||||
List<string> uncoloured = [.. AppXaml().Where(static x => string.Equals(x.Xaml.Root!.Name.LocalName, "Page", StringComparison.Ordinal)
|
||||
&& !string.Equals(x.Xaml.Root.Attribute("Foreground")?.Value, "{DynamicResource TextFillColorPrimaryBrush}", StringComparison.Ordinal))
|
||||
.Select(static x => x.File)];
|
||||
|
||||
pages.Should().HaveCountGreaterThanOrEqualTo(6);
|
||||
string.Join(", ", uncoloured).Should().BeEmpty("a Frame passes no text colour into a page: each sets Foreground=\"{DynamicResource TextFillColorPrimaryBrush}\" (16_WPFUI_SYNTAX §Gotchas)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A stock <c>ScrollViewer</c> takes every wheel, even with nothing left to scroll; inside a dialog that scrolls, the wheel
|
||||
/// then stops at it. WPF UI's <c>PassiveScrollViewer</c> hands the wheel on at its ends (beta.14).
|
||||
|
||||
@@ -23,13 +23,6 @@ public sealed class ContrastTests
|
||||
{
|
||||
private static readonly string[] _paletteAppearances = ["Info", "Caution", "Danger", "Success"];
|
||||
|
||||
/// <summary>
|
||||
/// Windows' default accent. The accent brushes are not in the theme dictionaries: `ApplicationThemeManager.Apply(…,
|
||||
/// updateAccent: true)` derives them from the system accent at start-up (`MainWindow`), so the test derives them the
|
||||
/// same way from a fixed colour and measures WPF UI's own on-accent text against them.
|
||||
/// </summary>
|
||||
private static readonly Color _defaultAccent = Color.FromRgb(0x00, 0x78, 0xD4);
|
||||
|
||||
[Fact]
|
||||
public void NoBadgeUsesAPaletteAppearance()
|
||||
{
|
||||
@@ -143,10 +136,12 @@ public sealed class ContrastTests
|
||||
[InlineData(ApplicationTheme.Light)]
|
||||
public async Task EveryPillPairMeetsAAInBothThemes(ApplicationTheme theme)
|
||||
{
|
||||
Dictionary<string, double> ratios = await PagesLoadTests.OnStaAsync(() =>
|
||||
// The accent brushes are not in the theme dictionaries: the App derives them from the system accent at each theme
|
||||
// switch, and Visuals.UnderTheme derives them the same way from Windows' default accent. Until 2026-10-07 this
|
||||
// passed systemAccentColor: true, which reads the machine's own accent palette wherever Windows answers.
|
||||
Dictionary<string, double> ratios = await PagesLoadTests.OnStaAsync(() => Visuals.UnderTheme(theme, () =>
|
||||
{
|
||||
var themed = new ThemesDictionary { Theme = theme };
|
||||
ApplicationAccentColorManager.Apply(_defaultAccent, theme, systemGlassColor: false, systemAccentColor: true);
|
||||
Color window = Wcag.Resolve(themed, "ApplicationBackgroundColor");
|
||||
Color card = Wcag.Over(Wcag.Resolve(themed, "CardBackgroundFillColorDefault"), window);
|
||||
Color pillOff = Wcag.Over(Wcag.Resolve(themed, "ControlFillColorDefault"), card);
|
||||
@@ -159,7 +154,7 @@ public sealed class ContrastTests
|
||||
["qualifier warning: primary text on caution"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), caution), caution),
|
||||
["the Info badge, for the record"] = Wcag.Ratio(Wcag.Over(Wcag.Resolve(themed, "TextFillColorPrimary"), PaletteLightBlue()), PaletteLightBlue()),
|
||||
};
|
||||
});
|
||||
}));
|
||||
|
||||
using (new FluentAssertions.Execution.AssertionScope(theme.ToString()))
|
||||
{
|
||||
|
||||
@@ -171,6 +171,31 @@ public sealed class FormatsTests
|
||||
Formats.Engine(null).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.19: each RPG Maker rule covers several makers, and the file the version was read from names which; the RGSS
|
||||
/// number is the runtime library's, and says so.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheVersionsWitnessNamesTheMakerAndRgssSaysWhoseNumberItIs()
|
||||
{
|
||||
Formats.Engine("rpgmaker_mv", EngineVersionSource.RpgMakerMzCore).Should().Be("RPG Maker MZ");
|
||||
Formats.Engine("rpgmaker_mv", EngineVersionSource.RpgMakerMvCore).Should().Be("RPG Maker MV");
|
||||
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss1Library).Should().Be("RPG Maker XP");
|
||||
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss2Library).Should().Be("RPG Maker VX");
|
||||
Formats.Engine("rpgmaker_rgss", EngineVersionSource.Rgss3Library).Should().Be("RPG Maker VX Ace");
|
||||
Formats.Engine("rpgmaker_mv", null).Should().Be("RPG Maker MV/MZ", "no witness, no maker");
|
||||
Formats.Engine("unity", EngineVersionSource.RpgMakerMzCore).Should().Be("Unity", "a witness names a maker only for its own rule");
|
||||
|
||||
Formats.EngineWithVersion("rpgmaker_mv", "1.10.0", EngineVersionSource.RpgMakerMzCore).Should().Be("RPG Maker MZ 1.10.0");
|
||||
Formats.EngineWithVersion("rpgmaker_rgss", "3.0.1", EngineVersionSource.Rgss3Library).Should().Be("RPG Maker VX Ace (RGSS 3.0.1)");
|
||||
Formats.EngineWithVersion("unity", "2022.3.39f1", EngineVersionSource.UnityPlayer).Should().Be("Unity 2022.3.39f1");
|
||||
Formats.EngineWithVersion("godot", "4.4.1", EngineVersionSource.GodotPack).Should().Be("Godot 4.4.1");
|
||||
Formats.EngineWithVersion("unreal", "5.4.4", EngineVersionSource.UnrealFileVersion).Should().Be("Unreal Engine 5.4.4");
|
||||
Formats.EngineWithVersion("unity", "6000.0", null).Should().Be("Unity 6000.0", "a version the user typed has no witness");
|
||||
Formats.EngineWithVersion("godot", null, null).Should().Be("Godot");
|
||||
Formats.EngineWithVersion(null, "1.0", null).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Every engine the shipped rules can detect has a name here, and it is the rule's own <c>name</c> (2026-09-23): a rule
|
||||
/// added without one would show its raw id on every card that engine lands on — which is what every engine did until
|
||||
|
||||
@@ -107,12 +107,19 @@ public sealed class GameDetailViewModelTests
|
||||
|
||||
private sealed class FakePicker(string? path) : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => path;
|
||||
/// <summary>The folder each pick was asked to open in.</summary>
|
||||
public List<string?> Folders { get; } = [];
|
||||
|
||||
public string? PickExecutable(string? initialDirectory = null)
|
||||
{
|
||||
Folders.Add(initialDirectory);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<(GameDetailViewModel Vm, FakeAgent Agent, FakePrompt Prompt, FakeNavigator Nav, FakeStrip Strip)> BuildAsync(
|
||||
ScratchLedger s, long gameId, RemoveGameChoice remove = RemoveGameChoice.Cancel, GameMetadata? edit = null, string? pick = null,
|
||||
FakeAgent? withAgent = null, RegisteredSettings? settings = null, UiMode? mode = null)
|
||||
FakeAgent? withAgent = null, RegisteredSettings? settings = null, UiMode? mode = null, FakePicker? picker = null)
|
||||
{
|
||||
FakeAgent agent = withAgent ?? new FakeAgent();
|
||||
var prompt = new FakePrompt();
|
||||
@@ -121,7 +128,7 @@ public sealed class GameDetailViewModelTests
|
||||
var vm = new GameDetailViewModel(s.Library, new GameSelection { GameId = gameId }, new HookingConsent(agent, prompt), nav,
|
||||
new FakeConfirmations(remove), new FakeEdit(edit), strip, new NoSummaries(),
|
||||
new Charts.SessionSeriesLoader(s.Sessions), new Infrastructure.Persistence.SqliteHardwareSnapshotRepository(s.Db), new SessionSelection(),
|
||||
new FakePicker(pick), settings, mode: mode);
|
||||
picker ?? new FakePicker(pick), settings, mode: mode);
|
||||
Task pending = vm.Pending;
|
||||
await pending.ConfigureAwait(false);
|
||||
return (vm, agent, prompt, nav, strip);
|
||||
@@ -613,7 +620,47 @@ public sealed class GameDetailViewModelTests
|
||||
.And.Contain(new GameDetailRow("Engine version", Strings.GameDetail_EngineVersion_NotFound), "an Unreal title says its version was not found rather than nothing");
|
||||
|
||||
(GameDetailViewModel gf2, _, _, _, _) = await BuildAsync(s, unity.Id);
|
||||
gf2.Details.Should().NotContain(r => r.Label == "Engine version", "other engines add no line");
|
||||
gf2.Details.Should().NotContain(r => r.Label == "Engine version", "a version an older rules file's extractor wrote names no witness");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.19: a Unity, Godot or RPG Maker version says what it was read from, RPG Maker's witness names the maker in the
|
||||
/// header, and such a title whose files named no version says so once the sweep has read it.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom()
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
ValueTask<int> SetAsync(long id, string engine, string? version, string? source) => s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(
|
||||
"UPDATE games SET engine = @engine, engine_version = @version, engine_version_source = @source, exe_machine = 'x64' WHERE id = @id",
|
||||
new { id, engine, version, source }, tx, cancellationToken: ct)), Ct);
|
||||
(string Name, string Engine, string? Version, string? Source, string Subtitle, string Witness)[] cases =
|
||||
[
|
||||
("A Doll's Locket - Remake", "rpgmaker_mv", "1.10.0", EngineVersionSource.RpgMakerMzCore, "RPG Maker MZ 1.10.0", "From the first lines of the game's js/rmmz_core.js."),
|
||||
("City of Bones", "rpgmaker_rgss", "3.0.1", EngineVersionSource.Rgss3Library, "RPG Maker VX Ace (RGSS 3.0.1)", Strings.GameDetail_EngineVersion_Rgss),
|
||||
("xiandie", "godot", "4.4.1", EngineVersionSource.GodotPack, "Godot 4.4.1", Strings.GameDetail_EngineVersion_GodotPack),
|
||||
("GF2", "unity", "2019.4.40", EngineVersionSource.UnityPlayerFile, "Unity 2019.4.40", Strings.GameDetail_EngineVersion_UnityPlayerFile),
|
||||
("Unread", "unity", null, null, "Unity", Strings.GameDetail_EngineVersion_NotFoundInFiles),
|
||||
];
|
||||
foreach ((string name, string engine, string? version, string? source, string subtitle, string witness) in cases)
|
||||
{
|
||||
GameRow row = await s.GameAsync(name);
|
||||
await SetAsync(row.Id, engine, version, source);
|
||||
|
||||
(GameDetailViewModel vm, _, _, _, _) = await BuildAsync(s, row.Id);
|
||||
|
||||
vm.Subtitle.Should().EndWith(subtitle, name);
|
||||
vm.Details.Should().Contain(new GameDetailRow("Engine version", witness), name);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -815,6 +862,36 @@ public sealed class GameDetailViewModelTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.19 (owner request 2026-10-12): the pick opens in the game's own root folder — a Steam install's folder under
|
||||
/// <c>steamapps\common</c>, not the <c>bin\x64</c> the executable sits in, and not wherever the dialog was last.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task ChangingTheExecutableOpensThePickInTheGamesOwnFolder()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string library = Path.Combine(Path.GetTempPath(), "fl-pick-" + Guid.NewGuid().ToString("N"));
|
||||
string install = Path.Combine(library, "steamapps", "common", "Title");
|
||||
Directory.CreateDirectory(Path.Combine(install, "bin", "x64"));
|
||||
try
|
||||
{
|
||||
GameRow game = await s.GameAsync("Title", Infrastructure.Io.ExecutableIdentity.Normalise(Path.Combine(install, "bin", "x64", "Title.exe")));
|
||||
var picker = new FakePicker(null);
|
||||
(GameDetailViewModel vm, _, _, _, FakeStrip strip) = await BuildAsync(s, game.Id, picker: picker);
|
||||
|
||||
vm.ChangeExecutableCommand.Execute(null);
|
||||
Task pending = vm.Pending;
|
||||
await pending;
|
||||
|
||||
picker.Folders.Should().Equal([install], "the install root under steamapps\\common, not bin\\x64");
|
||||
strip.Lines.Should().BeEmpty("a cancelled pick changes nothing");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(library, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ChangingTheExecutableToAnUnreadableFileOrCancellingChangesNothing()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Where Change executable… opens (beta.19, owner request 2026-10-12): the game's root folder for each layout the library
|
||||
/// holds — a store's install folder, an Unreal package outside a store, a loose folder — the nearest folder still there for
|
||||
/// an entry whose folder is gone, and nothing for a drive that is not connected.
|
||||
/// </summary>
|
||||
public sealed class GameFolderTests : IDisposable
|
||||
{
|
||||
private readonly string _dir = Path.Combine(Path.GetTempPath(), "fl-gamefolder-" + Guid.NewGuid().ToString("N"));
|
||||
|
||||
public GameFolderTests() => Directory.CreateDirectory(_dir);
|
||||
|
||||
public void Dispose() => Directory.Delete(_dir, recursive: true);
|
||||
|
||||
private string Sub(params string[] parts)
|
||||
{
|
||||
string p = Path.Combine([_dir, .. parts]);
|
||||
Directory.CreateDirectory(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AStoreInstallOpensAtItsFolderUnderTheStoresBoundary()
|
||||
{
|
||||
string install = Sub("SteamLibrary", "steamapps", "common", "Lies of P");
|
||||
string bin = Sub("SteamLibrary", "steamapps", "common", "Lies of P", "LiesofP", "Binaries", "Win64");
|
||||
|
||||
GameFolder.StartFolder(Path.Combine(bin, "LiesofP-Win64-Shipping.exe")).Should().Be(install);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnUnrealPackageOutsideAStoreOpensAboveItsProjectFolder()
|
||||
{
|
||||
string root = Sub("Games", "Hell Is Us");
|
||||
string bin = Sub("Games", "Hell Is Us", "HellIsUs", "Binaries", "Win64");
|
||||
|
||||
GameFolder.StartFolder(Path.Combine(bin, "HellIsUs-Win64-Shipping.exe")).Should().Be(root, "<root>\\<Project>\\Binaries\\Win64 is Unreal's own layout");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ALooseFolderOpensWhereTheExecutableIs()
|
||||
{
|
||||
string game = Sub("it", "a-dolls-locket-remake", "Dolls Locket");
|
||||
|
||||
GameFolder.StartFolder(Path.Combine(game, "notification_helper.exe")).Should().Be(game);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFolderThatIsGoneOpensAtTheNearestOneStillThere()
|
||||
{
|
||||
string library = Sub("it");
|
||||
|
||||
GameFolder.StartFolder(Path.Combine(library, "uninstalled", "Sub", "Game.exe")).Should().Be(library, "the entry reads Not installed; its library folder is still there");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ADriveThatIsNotConnectedOpensNowhereInParticular()
|
||||
{
|
||||
char? absent = null;
|
||||
for (char letter = 'Z'; letter >= 'D'; letter--)
|
||||
{
|
||||
if (!Directory.Exists(letter + @":\"))
|
||||
{
|
||||
absent = letter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.SkipWhen(absent is null, "every drive letter from D to Z is in use on this machine");
|
||||
GameFolder.StartFolder(absent + @":\Games\Title\Title.exe").Should().BeNull("Windows then opens where the last pick was");
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public sealed class GamesViewModelTests
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
public string? PickExecutable(string? initialDirectory = null) => null;
|
||||
}
|
||||
|
||||
private sealed class NoStrip : IMessageStrip
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Markdown;
|
||||
using FrameLedger.App.Services;
|
||||
@@ -75,14 +77,108 @@ public sealed class GuideDocumentsTests
|
||||
dead.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Every link to a section — on the same page, another guide page, Limitations, or a document in the repository — names an
|
||||
/// anchor the App's own renderer gives that page's headings (beta.17: the guide grew from eight pages to twelve, and its
|
||||
/// pages link into each other's sections). Rendered as the window renders them, so GitHub's rules for a repeated heading
|
||||
/// and for punctuation are the ones checked.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ALinkToAnotherSectionOfTheGuideNamesAHeadingThatExists()
|
||||
public async Task EveryLinkToASectionNamesAHeadingOfItsPage()
|
||||
{
|
||||
// 05-your-data.md links to 01-install.md#updates: the anchor must be one the target page's headings produce.
|
||||
string install = EmbeddedDocuments.Read("guide/01-install.md");
|
||||
MarkdownDocument ast = Markdig.Markdown.Parse(install, MarkdownRenderer.Pipeline);
|
||||
string[] anchors = [.. ast.Descendants<HeadingBlock>().Select(static h => MarkdownLinks.Slug(string.Concat(h.Inline!.Descendants<LiteralInline>().Select(static l => l.Content.ToString()))))];
|
||||
string root = RepoRoot();
|
||||
var wanted = new List<(string Page, string Target, string Anchor)>();
|
||||
foreach (string page in EmbeddedDocuments.GuidePages)
|
||||
{
|
||||
MarkdownDocument ast = Markdig.Markdown.Parse(EmbeddedDocuments.Read(page), MarkdownRenderer.Pipeline);
|
||||
foreach (string href in ast.Descendants<LinkInline>().Where(static l => !l.IsImage).Select(static l => l.Url ?? string.Empty))
|
||||
{
|
||||
MarkdownLinkTarget target = MarkdownLinks.Resolve(page, href);
|
||||
if (target is { Anchor: { } anchor, External: null })
|
||||
{
|
||||
wanted.Add((page, target.RepositoryPath ?? page, anchor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anchors.Should().Contain("updates");
|
||||
wanted.Should().NotBeEmpty("the guide links into its own sections");
|
||||
List<string> dead = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
var missing = new List<string>();
|
||||
var anchors = new Dictionary<string, IReadOnlyDictionary<string, System.Windows.Documents.Block>>(StringComparer.Ordinal);
|
||||
foreach ((string page, string target, string anchor) in wanted)
|
||||
{
|
||||
if (!anchors.TryGetValue(target, out IReadOnlyDictionary<string, System.Windows.Documents.Block>? known))
|
||||
{
|
||||
bool limitations = string.Equals(target, LimitationsDocument.ResourceName, StringComparison.Ordinal);
|
||||
string text = limitations ? LimitationsDocument.Load()
|
||||
: target.StartsWith("guide/", StringComparison.Ordinal) ? EmbeddedDocuments.Read(target)
|
||||
: File.ReadAllText(Path.Combine(root, target.Replace('/', Path.DirectorySeparatorChar)));
|
||||
known = MarkdownRenderer.Render(text, target).Anchors;
|
||||
anchors[target] = known;
|
||||
}
|
||||
|
||||
if (!known.ContainsKey(anchor))
|
||||
{
|
||||
missing.Add($"{page}: {target}#{anchor}");
|
||||
}
|
||||
}
|
||||
|
||||
return missing;
|
||||
});
|
||||
|
||||
string.Join(Environment.NewLine, dead).Should().BeEmpty("a section link that names no heading opens the page at its top, or nowhere");
|
||||
}
|
||||
|
||||
/// <summary>The guide's contents list names its pages in the order the App lists them (beta.17).</summary>
|
||||
[Fact]
|
||||
public void TheContentsListThePagesInTheAppsOrder()
|
||||
{
|
||||
MarkdownDocument ast = Markdig.Markdown.Parse(EmbeddedDocuments.Read("guide/README.md"), MarkdownRenderer.Pipeline);
|
||||
string[] listed = [.. ast.Descendants<LinkInline>()
|
||||
.Select(static l => MarkdownLinks.Resolve("guide/README.md", l.Url).RepositoryPath)
|
||||
.OfType<string>()
|
||||
.Where(static path => path.StartsWith("guide/", StringComparison.Ordinal))
|
||||
.Distinct(StringComparer.Ordinal)];
|
||||
|
||||
listed.Should().Equal(EmbeddedDocuments.GuidePages.Skip(1), "guide/README.md is the contents, and the window lists the pages in that order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// "Every setting" names every setting the Settings page shows, by its English label (beta.17): a setting added to the
|
||||
/// page and not to the guide is red here, not a question a player cannot find the answer to.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TheSettingsPageOfTheGuideNamesEverySetting()
|
||||
{
|
||||
string xaml = File.ReadAllText(Path.Combine(RepoRoot(), "src", "FrameLedger.App", "Pages", "SettingsPage.xaml"));
|
||||
IEnumerable<string> keys = Regex.Matches(xaml, @"res:Strings\.(?<key>Settings_\w+_Label)\b", RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1))
|
||||
.Select(static m => m.Groups["key"].Value)
|
||||
.Concat(["Settings_Theme_Label", "Settings_Language_Label"]);
|
||||
|
||||
Unnamed(keys, EmbeddedDocuments.Read("guide/08-settings.md")).Should().BeEmpty("guide/08-settings.md names every setting the page shows");
|
||||
}
|
||||
|
||||
/// <summary>"The screens" names every page of the navigation and every menu item, by its English text (beta.17).</summary>
|
||||
[Fact]
|
||||
public void TheScreensPageOfTheGuideNamesEveryPageAndMenuItem()
|
||||
{
|
||||
string xaml = File.ReadAllText(Path.Combine(RepoRoot(), "src", "FrameLedger.App", "MainWindow.xaml"));
|
||||
IEnumerable<string> keys = Regex.Matches(xaml, @"res:Strings\.(?<key>(?:Nav|Menu)_\w+)\b", RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1))
|
||||
.Select(static m => m.Groups["key"].Value);
|
||||
|
||||
Unnamed(keys, EmbeddedDocuments.Read("guide/07-screens.md")).Should().BeEmpty("guide/07-screens.md names every page and menu item");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The English text of each key that <paramref name="page"/> does not contain — the menu's access-key underscore and a
|
||||
/// trailing ellipsis removed, since the guide writes "File ▸ Add game".
|
||||
/// </summary>
|
||||
private static List<string> Unnamed(IEnumerable<string> keys, string page) =>
|
||||
[
|
||||
.. keys.Distinct(StringComparer.Ordinal)
|
||||
.Select(static key => (Key: key, Text: (Strings.ResourceManager.GetString(key, CultureInfo.GetCultureInfo("en")) ?? key).Replace("_", string.Empty, StringComparison.Ordinal).TrimEnd('…', '.')))
|
||||
.Where(k => !page.Contains(k.Text, StringComparison.Ordinal))
|
||||
.Select(static k => $"{k.Key}: \"{k.Text}\""),
|
||||
];
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public sealed partial class MarkdownRendererTests
|
||||
text.Should().Contain(" 0. Definitions.").And.Contain(" # not a heading", "the GPL is not Markdown: its numbered sections are not a list");
|
||||
}
|
||||
|
||||
/// <summary>Every embedded document — the Legal Gate's four, LIMITATIONS, NOTICE, the trademark note, the third-party notices, the package index and the user guide's eight pages.</summary>
|
||||
/// <summary>Every embedded document — the Legal Gate's four, LIMITATIONS, NOTICE, the trademark note, the third-party notices, the package index and the user guide's twelve pages (eight until beta.17).</summary>
|
||||
[Fact]
|
||||
public async Task NothingAnyEmbeddedDocumentSaysIsDropped()
|
||||
{
|
||||
@@ -155,7 +155,7 @@ public sealed partial class MarkdownRendererTests
|
||||
return problems;
|
||||
});
|
||||
|
||||
documents.Should().HaveCount(17, "nine documents and the guide's eight pages");
|
||||
documents.Should().HaveCount(21, "nine documents and the guide's twelve pages");
|
||||
missing.Should().BeEmpty("the renderer must never shorten a document a user reads or accepts");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Application.AntiCheat;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Ipc;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.AntiCheat;
|
||||
using FrameLedger.Domain.Consent;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.18: a notice is made from what the Agent sends, so these are made from what the Agent sends — the gate's own
|
||||
/// verdicts, the verdicts the native guard's facade builds (<see cref="AntiCheatVerdict.FromNative"/>), published by
|
||||
/// <see cref="RecordedSessionEvents.PublishReason"/> through the wire's codec — never an event written by hand. Hand-written
|
||||
/// events had been the notices' only tests ("GuardBlocked", "HookFaulted", a guard reason sent as the end) while the Agent's
|
||||
/// own read "The hook stopped (WriterSelfDisabled)…", "kill switch was detected in this game (… (FR-2.4) …)" and "Access is
|
||||
/// denied was detected while the game was running".
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class NoticesFromTheAgentTests
|
||||
{
|
||||
private static readonly ExecutableFingerprint _onDisk = new() { ExePath = @"C:\Games\Title\game.exe", SizeBytes = 90_000, MtimeUnixMs = 1_700_000_000_000 };
|
||||
|
||||
/// <summary>The gate's refusal of a game blocked before, labelled as <c>HookedCaptureGate</c> labels it.</summary>
|
||||
private static readonly AntiCheatVerdict _blockedBefore =
|
||||
AntiCheatVerdict.Refused(AntiCheatRefusalReason.PreviouslyBlocked, "previously blocked", "AntiCheatFile|NetEase Yidun|NEP2.dll");
|
||||
|
||||
/// <summary>What a user must never read in a notice: the enums' names, a requirement's id, the fallback's "reason X".</summary>
|
||||
private static readonly Regex[] _internal =
|
||||
[
|
||||
.. Enum.GetNames<SessionEndReason>().Concat(Enum.GetNames<AntiCheatRefusalReason>()).Select(static n => Pattern(@"\b" + n + @"\b")),
|
||||
Pattern(@"FR-\d"),
|
||||
Pattern(@"\breason [A-Z]"),
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// "kill switch was detected in this game (the global 'disable all hooking' switch is on (FR-2.4); …)" until beta.18. The
|
||||
/// switch is checked before anything else, so the gate refuses even a record nobody stored, and its guard is never asked.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task DisableAllHookingIsTheUsersSwitchNeverAFinding()
|
||||
{
|
||||
AntiCheatVerdict gate = await new HookedCaptureGate(new UnaskedGuard())
|
||||
.StartAsync(HookRequest.FromConsent(default, _onDisk, targetPid: 4242, @"C:\FrameLedger\FrameLedger.Overlay.dll", killSwitchEngaged: true),
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedKillSwitch, Verdict = gate }));
|
||||
|
||||
gate.Family.Should().Be("kill switch", "the gate labels its own refusal in the family's place — which is what the notice printed");
|
||||
notice.Body.Should().Be("All hooking is switched off in Settings, so nothing was measured. " + Strings.Notice_Refused_Recording);
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A game with its user-mode exception granted and the option since turned off (D33): hooking is on, the row is blocked,
|
||||
/// no family is tolerated. The verdict is the gate's as <c>HookedCaptureGate</c> labels it — a stored record is not a
|
||||
/// test's to make (Domain's InternalsVisibleTo).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AGameBlockedBeforeIsSaidAsThatNeverAsAFindingNamedPreviouslyBlocked()
|
||||
{
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedPreviouslyBlocked, Verdict = _blockedBefore }));
|
||||
|
||||
notice.Body.Should().StartWith("Anti-cheat was found in this game before, so it is never hooked.").And.NotContain("previously blocked was detected");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AGuardRefusalThatNamesNoFamilyIsSaidInTheGuardsWords()
|
||||
{
|
||||
AntiCheatVerdict wow64 = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.TargetIsWow64, string.Empty, "target is a WOW64 process");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedByGuard, Verdict = wow64 }));
|
||||
|
||||
notice.Body.Should().StartWith("The anti-cheat guard did not hook this game: the game is 32-bit, and the hook runs in 64-bit games only.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>An agent from before beta.18 sent no guard reason beside no family: the end's own words, not its name.</summary>
|
||||
[Fact]
|
||||
public void AnOlderAgentsFamilylessRefusalIsStillWords()
|
||||
{
|
||||
SafetyNotice notice = InEnglish(() => new SafetyNotices(new FakeAgentLink(), new RecordingStrip()).Translate(
|
||||
FakeAgentLink.Envelope(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", null, "target is a WOW64 process")))!);
|
||||
|
||||
notice.Body.Should().StartWith("The anti-cheat guard refused to hook this game.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The control: a finding is still said as one, by its family and signal.</summary>
|
||||
[Fact]
|
||||
public void AFindingIsStillNamed()
|
||||
{
|
||||
AntiCheatVerdict found = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.BlockedModule, "BattlEye", "BEClient_x64.dll");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = SessionEndReason.RefusedByGuard, Verdict = found, HookingTurnedOff = true }));
|
||||
|
||||
notice.Body.Should().StartWith("BattlEye was detected in this game (BEClient_x64.dll).");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The 30 s re-scan could not read the game's process while it still ran (an exit is relabelled, D48(b)).</summary>
|
||||
[Fact]
|
||||
public void AReScanThatCouldNotLookIsNotAFinding()
|
||||
{
|
||||
AntiCheatVerdict unreadable = AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ProcessUnreadable, string.Empty, "Access is denied.");
|
||||
|
||||
SafetyNotice notice = InEnglish(() => Notice(new CaptureOutcome { Reason = ExitScanRelabel.EndOf(unreadable, targetExited: false), Verdict = unreadable }));
|
||||
|
||||
notice.Kind.Should().Be(SafetyNoticeKind.Unhooked);
|
||||
notice.Body.Should().Be("Capture stopped while the game was running — the game's process could not be opened — and FrameLedger unhooked.");
|
||||
Leaks(notice).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Every end that stops measuring mid-session is said in its own sentence, and never as continuing.</summary>
|
||||
[Fact]
|
||||
public void EveryStopMidSessionIsItsOwnSentence()
|
||||
{
|
||||
List<SessionEndReason> stops = [.. Enum.GetValues<SessionEndReason>().Where(static r => RecordedSessionEvents.Classify(r) == RecordedSessionEvents.Kind.Degraded)];
|
||||
|
||||
List<string> wrong = InEnglish(() => stops
|
||||
.Select(r => (Reason: r, Notice: Notice(new CaptureOutcome { Reason = r, Verdict = AntiCheatVerdict.Allowed() })))
|
||||
.Where(static x => !string.Equals(x.Notice.Body, Formats.EndReasonText(x.Reason.ToString()), StringComparison.Ordinal) || Leaks(x.Notice).Count > 0
|
||||
|| x.Notice.Body.Contains("continues", StringComparison.Ordinal))
|
||||
.Select(static x => $"{x.Reason}: \"{x.Notice.Body}\"")
|
||||
.ToList());
|
||||
|
||||
stops.Should().Contain([SessionEndReason.WriterSelfDisabled, SessionEndReason.KillSwitchEngaged]);
|
||||
string.Join(Environment.NewLine, wrong).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>Every refusal the Agent publishes, each with the verdict it comes with, reads without an internal name.</summary>
|
||||
[Fact]
|
||||
public async Task EveryRefusalReadsAsWords()
|
||||
{
|
||||
AntiCheatVerdict killSwitch = await new HookedCaptureGate(new UnaskedGuard())
|
||||
.StartAsync(HookRequest.FromConsent(default, _onDisk, targetPid: 4242, @"C:\FrameLedger\FrameLedger.Overlay.dll", killSwitchEngaged: true),
|
||||
TestContext.Current.CancellationToken);
|
||||
List<SessionEndReason> refusals = [.. Enum.GetValues<SessionEndReason>().Where(static r => RecordedSessionEvents.Classify(r) == RecordedSessionEvents.Kind.Refused)];
|
||||
|
||||
List<string> wrong = InEnglish(() => refusals
|
||||
.Select(r => (Reason: r, Notice: Notice(new CaptureOutcome
|
||||
{
|
||||
Reason = r,
|
||||
Verdict = r switch
|
||||
{
|
||||
SessionEndReason.RefusedKillSwitch => killSwitch,
|
||||
SessionEndReason.RefusedPreviouslyBlocked => _blockedBefore,
|
||||
SessionEndReason.RefusedByGuard => AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ModuleScanFailed, string.Empty, "Only part of a ReadProcessMemory request was completed."),
|
||||
_ => default,
|
||||
},
|
||||
})))
|
||||
.Where(static x => Leaks(x.Notice).Count > 0)
|
||||
.Select(static x => $"{x.Reason}: \"{x.Notice.Body}\" ({string.Join(", ", Leaks(x.Notice))})")
|
||||
.ToList());
|
||||
|
||||
refusals.Should().HaveCountGreaterThanOrEqualTo(5);
|
||||
string.Join(Environment.NewLine, wrong).Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The one safety event <paramref name="outcome"/> publishes, over the wire's codec, as the App's notice.</summary>
|
||||
private static SafetyNotice Notice(CaptureOutcome outcome)
|
||||
{
|
||||
var pipe = new Pipe();
|
||||
RecordedSessionEvents.PublishReason(pipe, Guid.NewGuid(), outcome,
|
||||
new SessionStartedInfo(Guid.NewGuid(), 7, "Title", _onDisk.ExePath, CaptureMode.Attach, DateTimeOffset.UnixEpoch, 10_000_000));
|
||||
IpcEnvelope sent = pipe.Sent.Should().ContainSingle($"{outcome.Reason} publishes one event").Subject;
|
||||
using var notices = new SafetyNotices(new FakeAgentLink(), new RecordingStrip());
|
||||
return notices.Translate(sent) ?? throw new InvalidOperationException($"{sent.Type} made no notice");
|
||||
}
|
||||
|
||||
private static List<string> Leaks(SafetyNotice notice) => [.. _internal.Select(r => r.Match(notice.Body)).Where(static m => m.Success).Select(static m => m.Value)];
|
||||
|
||||
private static Regex Pattern(string pattern) => new(pattern, RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1));
|
||||
|
||||
private static T InEnglish<T>(Func<T> f)
|
||||
{
|
||||
CultureInfo? app = Strings.Culture;
|
||||
CultureInfo? shared = Shared.Strings.Culture;
|
||||
CultureInfo current = CultureInfo.CurrentCulture;
|
||||
try
|
||||
{
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
Shared.Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en");
|
||||
return f();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = app;
|
||||
Shared.Strings.Culture = shared;
|
||||
CultureInfo.CurrentCulture = current;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Pipe : IIpcEventPublisher
|
||||
{
|
||||
public List<IpcEnvelope> Sent { get; } = [];
|
||||
|
||||
public bool HasClients => true;
|
||||
|
||||
public void Publish<T>(string type, T payload)
|
||||
where T : class => Sent.Add(IpcCodec.Decode(IpcCodec.Encode(type, null, payload)));
|
||||
}
|
||||
|
||||
/// <summary>A guard that must not be reached: every refusal these tests take from the gate is the gate's own.</summary>
|
||||
private sealed class UnaskedGuard : IAntiCheatGuard
|
||||
{
|
||||
public ValueTask<AntiCheatVerdict> EvaluateAsync(int targetPid, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> GuardedInjectAsync(int targetPid, string payloadPath, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> GuardedInjectWhenReadyAsync(int targetPid, string payloadPath, int timeoutMs, string? toleratedFamily,
|
||||
CancellationToken ct = default) => throw Asked();
|
||||
|
||||
public ValueTask<AntiCheatVerdict> PreScanGameAsync(string executablePath, string? toleratedFamily, CancellationToken ct = default) => throw Asked();
|
||||
|
||||
private static InvalidOperationException Asked() => new("the gate asked the guard");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using FluentAssertions;
|
||||
using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Markup;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Every text the App shows is readable in both themes (beta.18, the owner's screenshots of beta.17 in the dark theme: each
|
||||
/// page's title and section headings near-black on the dark window). Each surface is hosted as the App hosts it
|
||||
/// (<see cref="Hosted"/>): a page in WPF UI's <c>NavigationViewContentPresenter</c>, which is a <c>Frame</c>, and a Frame
|
||||
/// sets <c>InheritanceBehavior.SkipToAppNow</c> — nothing above it, the window's text colour included, reaches the page. A
|
||||
/// text with no colour of its own then falls back to the TextBlock default, which WPF UI 4.3.0's <c>TextBlockMetadata</c>
|
||||
/// sets to black. Text inside a card or a grid never showed it: their templates set a colour. The theme-switch check could
|
||||
/// not see it either: it compares a switched surface with a fresh one, and black was black in both.
|
||||
/// </summary>
|
||||
public sealed partial class PagesLoadTests
|
||||
{
|
||||
/// <summary>WCAG's minimum for large text and for what a user must make out; black on the dark window is 1.3.</summary>
|
||||
private const double _readableAtLeast = 3.0;
|
||||
|
||||
[Theory]
|
||||
[InlineData(ApplicationTheme.Dark)]
|
||||
[InlineData(ApplicationTheme.Light)]
|
||||
public async Task EveryTextIsReadableInBothThemes(ApplicationTheme theme)
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
using Surfaces surfaces = await Surfaces.LoadAsync(s);
|
||||
|
||||
(int Texts, List<string> Faint) result = await OnStaAsync(() => Visuals.UnderTheme(theme, () =>
|
||||
{
|
||||
Color window = Wcag.Resolve(new ThemesDictionary { Theme = theme }, "ApplicationBackgroundColor");
|
||||
int texts = 0;
|
||||
var faint = new List<string>();
|
||||
foreach ((string name, Func<FrameworkElement> build) in surfaces.All())
|
||||
{
|
||||
(Window host, FrameworkElement root) = Hosted(build);
|
||||
try
|
||||
{
|
||||
Lay(root);
|
||||
foreach (TextBlock text in ShownTexts(root))
|
||||
{
|
||||
texts++;
|
||||
Color under = Visuals.PaintedUnder(text, root, window);
|
||||
double ratio = Wcag.Ratio(Visuals.TextOver(text, under), under);
|
||||
if (ratio < _readableAtLeast)
|
||||
{
|
||||
faint.Add(string.Create(CultureInfo.InvariantCulture, $"{name}: \"{text.Text}\" {ratio:0.00}:1 ({text.Foreground} on {under})"));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
host.Close();
|
||||
}
|
||||
}
|
||||
|
||||
return (texts, faint);
|
||||
}));
|
||||
|
||||
result.Texts.Should().BeGreaterThan(300, "every surface was rendered and holds text");
|
||||
string.Join(Environment.NewLine, result.Faint).Should().BeEmpty($"every text the App shows reads at {_readableAtLeast}:1 or better in the {theme} theme");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The non-empty texts under <paramref name="root"/> that a user can see and is meant to read: no collapsed or hidden
|
||||
/// element above them, and none disabled (WCAG asks nothing of an inactive control's text).
|
||||
/// </summary>
|
||||
private static IEnumerable<TextBlock> ShownTexts(DependencyObject root)
|
||||
{
|
||||
if (root is UIElement { Visibility: not Visibility.Visible } or UIElement { IsEnabled: false })
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (root is TextBlock { Text.Length: > 0 } text && text.Foreground is SolidColorBrush)
|
||||
{
|
||||
yield return text;
|
||||
}
|
||||
|
||||
int count = VisualTreeHelper.GetChildrenCount(root);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
foreach (TextBlock child in ShownTexts(VisualTreeHelper.GetChild(root, i)))
|
||||
{
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,17 +121,22 @@ public sealed partial class PagesLoadTests
|
||||
try
|
||||
{
|
||||
Lay(fresh);
|
||||
List<(string Path, string Text, string Colour)> before = Texts(switched);
|
||||
List<(string Path, string Text, string Colour)> after = Texts(fresh);
|
||||
if (before.Count != after.Count)
|
||||
{
|
||||
return (before.Count, [$"{name}: {before.Count} texts after the switch, {after.Count} in a fresh one"]);
|
||||
}
|
||||
List<DrawnText> before = Texts(switched);
|
||||
List<DrawnText> after = Texts(fresh);
|
||||
Dictionary<string, DrawnText> lived = before.ToDictionary(static d => d.Path, StringComparer.Ordinal);
|
||||
Dictionary<string, DrawnText> made = after.ToDictionary(static d => d.Path, StringComparer.Ordinal);
|
||||
|
||||
// Texts are reported, never compared: another test class may change Strings.Culture between the two builds.
|
||||
List<string> stale = [.. before.Zip(after)
|
||||
.Where(static p => !string.Equals(p.First.Path, p.Second.Path, StringComparison.Ordinal) || !string.Equals(p.First.Colour, p.Second.Colour, StringComparison.Ordinal))
|
||||
.Select(p => $"{name}: \"{p.First.Text}\" is {p.First.Colour}, made fresh {p.Second.Colour} ({p.First.Path})")];
|
||||
// Texts are reported, never compared: another test class may change Strings.Culture between the two builds. What is
|
||||
// compared is what a user can see (beta.18, when pages moved into the Frame): inside a collapsed part a theme switch
|
||||
// re-applies a DataGrid's idle scroll bar, whose arrow glyphs then exist in the switched page only, and the select-all
|
||||
// corner — collapsed, every grid here shows column headers only — kept the old theme's disabled colour.
|
||||
List<string> stale =
|
||||
[
|
||||
.. before.Where(d => made.TryGetValue(d.Path, out DrawnText f) && (d.Shown || f.Shown) && !string.Equals(d.Colour, f.Colour, StringComparison.Ordinal))
|
||||
.Select(d => $"{name}: \"{d.Text}\" is {d.Colour}, made fresh {made[d.Path].Colour} ({d.Path})"),
|
||||
.. before.Where(d => d.Shown && !made.ContainsKey(d.Path)).Select(d => $"{name}: \"{d.Text}\" shows after the switch only ({d.Path})"),
|
||||
.. after.Where(d => d.Shown && !lived.ContainsKey(d.Path)).Select(d => $"{name}: \"{d.Text}\" shows in a fresh one only ({d.Path})"),
|
||||
];
|
||||
return (before.Count, stale.Count <= _staleShownPerSurface ? stale : [.. stale.Take(_staleShownPerSurface), $"{name}: … and {stale.Count - _staleShownPerSurface} more"]);
|
||||
}
|
||||
finally
|
||||
@@ -140,7 +145,12 @@ public sealed partial class PagesLoadTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A surface in a window that is never shown: itself when it is one, otherwise as the window's content.</summary>
|
||||
/// <summary>
|
||||
/// A surface hosted as the App shows it, in a window that is never shown: a window as itself; a page in WPF UI's
|
||||
/// <c>NavigationViewContentPresenter</c>, the shell's Frame — which passes no inherited value into the page, the text
|
||||
/// colour included (beta.18; until then pages sat straight in the window here, and their black titles inherited the
|
||||
/// window's colour in this check only); anything else as the window's content.
|
||||
/// </summary>
|
||||
private static (Window Host, FrameworkElement Root) Hosted(Func<FrameworkElement> build)
|
||||
{
|
||||
FrameworkElement built = build();
|
||||
@@ -149,6 +159,16 @@ public sealed partial class PagesLoadTests
|
||||
return (window, (FrameworkElement)window.Content);
|
||||
}
|
||||
|
||||
if (built is Page page)
|
||||
{
|
||||
var frame = new Wpf.Ui.Controls.NavigationViewContentPresenter();
|
||||
var shell = new Wpf.Ui.Controls.FluentWindow { Content = frame };
|
||||
Lay(frame);
|
||||
_ = frame.Navigate(page);
|
||||
Visuals.Pump();
|
||||
return (shell, frame);
|
||||
}
|
||||
|
||||
// A FluentWindow, as the shell is: its style gives the inherited text colour by theme resource too.
|
||||
var host = new Wpf.Ui.Controls.FluentWindow { Content = built };
|
||||
return (host, built);
|
||||
@@ -156,28 +176,34 @@ public sealed partial class PagesLoadTests
|
||||
|
||||
private static void Lay(FrameworkElement root) => Visuals.Layout(root, 1200, 900);
|
||||
|
||||
/// <summary>Every TextBlock under <paramref name="root"/> in visual-tree order: where it is, what it says, the colour it is drawn in.</summary>
|
||||
private static List<(string Path, string Text, string Colour)> Texts(DependencyObject root)
|
||||
/// <summary>
|
||||
/// Every TextBlock under <paramref name="root"/> in visual-tree order: where it is, what it says, the colour it is drawn
|
||||
/// in, and whether it shows — nothing above it collapsed or hidden.
|
||||
/// </summary>
|
||||
private static List<DrawnText> Texts(DependencyObject root)
|
||||
{
|
||||
var found = new List<(string, string, string)>();
|
||||
Walk(root, root.GetType().Name, found);
|
||||
var found = new List<DrawnText>();
|
||||
Walk(root, root.GetType().Name, shown: true, found);
|
||||
return found;
|
||||
}
|
||||
|
||||
private static void Walk(DependencyObject node, string path, List<(string, string, string)> found)
|
||||
private static void Walk(DependencyObject node, string path, bool shown, List<DrawnText> found)
|
||||
{
|
||||
shown &= node is not UIElement { Visibility: not Visibility.Visible };
|
||||
if (node is TextBlock text)
|
||||
{
|
||||
found.Add((path, text.Text, text.Foreground is SolidColorBrush solid ? solid.Color.ToString(CultureInfo.InvariantCulture) : text.Foreground?.ToString(CultureInfo.InvariantCulture) ?? "null"));
|
||||
found.Add(new DrawnText(path, text.Text, text.Foreground is SolidColorBrush solid ? solid.Color.ToString(CultureInfo.InvariantCulture) : text.Foreground?.ToString(CultureInfo.InvariantCulture) ?? "null", shown));
|
||||
}
|
||||
|
||||
int count = VisualTreeHelper.GetChildrenCount(node);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
DependencyObject child = VisualTreeHelper.GetChild(node, i);
|
||||
Walk(child, string.Create(CultureInfo.InvariantCulture, $"{path}/{child.GetType().Name}[{i}]"), found);
|
||||
Walk(child, string.Create(CultureInfo.InvariantCulture, $"{path}/{child.GetType().Name}[{i}]"), shown, found);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly record struct DrawnText(string Path, string Text, string Colour, bool Shown);
|
||||
|
||||
private static Color Solid(Brush brush) => brush is SolidColorBrush solid ? solid.Color : throw new InvalidOperationException("a text whose foreground is not a solid colour");
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public sealed partial class PagesLoadTests
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
public string? PickExecutable(string? initialDirectory = null) => null;
|
||||
}
|
||||
|
||||
private sealed class NoTheme : IThemeApplier
|
||||
|
||||
@@ -82,7 +82,7 @@ public sealed class ReasonTextTests
|
||||
|
||||
var link = new FakeAgentLink();
|
||||
using var notices = new SafetyNotices(link, new RecordingStrip());
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "PreScanFailed", null, "the folder could not be listed"));
|
||||
link.Raise(IpcMessageType.CaptureRefused, new CaptureRefusedEvent(7, "Title", "RefusedByGuard", null, "the folder could not be listed", GuardReason: "PreScanFailed"));
|
||||
notices.Items.Should().ContainSingle().Which.Body.Should().StartWith("The anti-cheat guard did not hook this game: the game's folder could not be scanned.")
|
||||
.And.NotContain("detected");
|
||||
new HookingConsentResult(HookingConsentOutcome.Refused, Refusal: new RefusedAck(7, "ProcessUnreadable", null, "Access is denied")).RefusalText()
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Pages;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
@@ -128,4 +130,181 @@ public sealed class ScrollBarHidingTests
|
||||
result.FirstAfterOff.Should().Be(ScrollBarVisibility.Auto, "and gives it back its own setting on its next load after off");
|
||||
result.LoadedAfterOff.Should().Be(ScrollBarVisibility.Visible, "a scroller the option never touched keeps what it has");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.17 (the owner's screenshot of 2026-10-07: the Dashboard kept its bar with the option on). WPF raises Loaded only on
|
||||
/// an element whose subtree listens for it with a handler of its own — an instance handler, a style's EventSetter or a
|
||||
/// template's trigger (<c>BroadcastEventHelper</c>, <c>FrameworkElement.ThisHasLoadedChangeEventHandler</c>) — and a
|
||||
/// class handler is none of those, so a scroller over plain cards and text never loaded as far as the option knew. Laid
|
||||
/// out with no Loaded at all, a scroller must be hidden all the same.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AScrollerLaidOutWithNoLoadedEventIsHidden()
|
||||
{
|
||||
(ScrollBarVisibility Axis, Visibility Bar, double Scrollable) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
ScrollBarHiding.Register();
|
||||
try
|
||||
{
|
||||
ScrollBarHiding.Apply(true);
|
||||
var viewer = new ScrollViewer { Height = 120, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Content = new Border { Height = 600 } };
|
||||
Visuals.Layout(viewer, 300, 120);
|
||||
return (viewer.VerticalScrollBarVisibility, viewer.ComputedVerticalScrollBarVisibility, viewer.ScrollableHeight);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
});
|
||||
|
||||
result.Scrollable.Should().BeGreaterThan(0, "the scroller has something to scroll");
|
||||
result.Axis.Should().Be(ScrollBarVisibility.Hidden, "the option reaches a scroller when it is laid out, Loaded or not");
|
||||
result.Bar.Should().NotBe(Visibility.Visible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The option as the owner has it: on at start-up (<c>App.RunAsync</c> applies it before the first window), then every
|
||||
/// surface shown in a real window off the screen — each page navigated in WPF UI's presenter as the shell does, the
|
||||
/// secondary windows, the first run, every dialog's content. No scroller that has something to scroll draws a bar. Before
|
||||
/// beta.17 Settings passed (its toggle switches' template has a Loaded trigger, so its scroller loaded) and the Dashboard
|
||||
/// did not; Settings and the Dashboard must both be scrollable here, or the check proves nothing.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task EverySurfaceShownWithTheOptionOnDrawsNoBar()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
using PagesLoadTests.Surfaces surfaces = await PagesLoadTests.Surfaces.LoadAsync(s);
|
||||
|
||||
(List<string> Bars, HashSet<string> Scrollable) result = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
ScrollBarHiding.Register();
|
||||
ScrollBarHiding.Apply(true);
|
||||
try
|
||||
{
|
||||
var bars = new List<string>();
|
||||
var scrollable = new HashSet<string>(StringComparer.Ordinal);
|
||||
foreach ((string name, Func<FrameworkElement> build) in surfaces.Pages())
|
||||
{
|
||||
Sweep(name, () => InPresenter(build()), bars, scrollable);
|
||||
}
|
||||
|
||||
foreach ((string name, Func<FrameworkElement> build) in surfaces.Windows().Concat(surfaces.Dialogs()))
|
||||
{
|
||||
Sweep(name, build, bars, scrollable);
|
||||
}
|
||||
|
||||
return (bars, scrollable);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ScrollBarHiding.Apply(false);
|
||||
}
|
||||
});
|
||||
|
||||
result.Scrollable.Should().Contain(["Dashboard", "Settings", "Logs", "User guide"], "the check is vacuous unless those scroll in a window this small");
|
||||
string.Join(Environment.NewLine, result.Bars).Should().BeEmpty("ui.hide_scrollbars: no scroller the App shows draws a bar, and the wheel still scrolls it");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The harness against WPF itself: a scroller of our own with a Loaded class handler, shown in a real window, is never
|
||||
/// called while it holds only a Border, and is called once it holds a CheckBox, whose template listens for Loaded. If the
|
||||
/// first half fails, WPF raises Loaded everywhere and the reason above is gone; if the second fails, the harness does not
|
||||
/// deliver Loaded and <see cref="EverySurfaceShownWithTheOptionOnDrawsNoBar"/> could not tell Settings from the Dashboard.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task WpfRaisesLoadedOnlyWhereASubtreeListensForIt()
|
||||
{
|
||||
(int WithBorder, int WithCheckBox) loads = await PagesLoadTests.OnStaAsync(() =>
|
||||
(LoadsOfAProbeHolding(new Border { Height = 40 }), LoadsOfAProbeHolding(new CheckBox { Content = "listens" })));
|
||||
|
||||
loads.WithBorder.Should().Be(0, "a class handler does not put an element on WPF's Loaded route");
|
||||
loads.WithCheckBox.Should().BeGreaterThan(0, "WPF UI's CheckBox template has a Loaded trigger, which does");
|
||||
}
|
||||
|
||||
private sealed class ProbeScrollViewer : ScrollViewer
|
||||
{
|
||||
static ProbeScrollViewer() => EventManager.RegisterClassHandler(typeof(ProbeScrollViewer), LoadedEvent, new RoutedEventHandler(static (_, _) => Loads++), handledEventsToo: true);
|
||||
|
||||
public static int Loads { get; private set; }
|
||||
}
|
||||
|
||||
private static int LoadsOfAProbeHolding(UIElement content)
|
||||
{
|
||||
var probe = new ProbeScrollViewer { Content = content };
|
||||
int before = ProbeScrollViewer.Loads;
|
||||
Window window = OffScreen(new Window { Content = probe });
|
||||
try
|
||||
{
|
||||
window.Show();
|
||||
Visuals.Pump();
|
||||
return ProbeScrollViewer.Loads - before;
|
||||
}
|
||||
finally
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A page navigated in WPF UI's presenter, as the shell's NavigationView hosts it.</summary>
|
||||
private static Grid InPresenter(FrameworkElement page)
|
||||
{
|
||||
var presenter = new Wpf.Ui.Controls.NavigationViewContentPresenter();
|
||||
_ = presenter.Navigate(page);
|
||||
return new Grid { Children = { presenter } };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the surface in a real window off the screen, lets WPF load and lay it out, and notes every scroller that has
|
||||
/// something to scroll and every one of those that draws a bar.
|
||||
/// </summary>
|
||||
private static void Sweep(string name, Func<FrameworkElement> build, List<string> bars, HashSet<string> scrollable)
|
||||
{
|
||||
FrameworkElement built = build();
|
||||
Window window = OffScreen(built as Window ?? new Window { Content = built });
|
||||
try
|
||||
{
|
||||
window.Show();
|
||||
Visuals.Pump();
|
||||
if (Visuals.Find<LogsPage>(window) is { } logs)
|
||||
{
|
||||
// The tail is empty in a scratch folder; fill it as a log file would.
|
||||
logs.Tail.Text = string.Join(Environment.NewLine, Enumerable.Range(1, 200).Select(static i => "line " + i.ToString(CultureInfo.InvariantCulture)));
|
||||
Visuals.Pump();
|
||||
}
|
||||
|
||||
foreach (ScrollViewer viewer in Visuals.FindAll<ScrollViewer>(window))
|
||||
{
|
||||
bool vertical = viewer.ScrollableHeight > 0.5;
|
||||
bool horizontal = viewer.ScrollableWidth > 0.5;
|
||||
if (vertical || horizontal)
|
||||
{
|
||||
_ = scrollable.Add(name);
|
||||
}
|
||||
|
||||
if ((vertical && viewer.ComputedVerticalScrollBarVisibility == Visibility.Visible)
|
||||
|| (horizontal && viewer.ComputedHorizontalScrollBarVisibility == Visibility.Visible))
|
||||
{
|
||||
bars.Add(string.Create(CultureInfo.InvariantCulture,
|
||||
$"{name}: {(viewer.TemplatedParent ?? viewer).GetType().Name} draws a bar ({viewer.ScrollableWidth:0} x {viewer.ScrollableHeight:0} to scroll)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A window shown where nobody sees it and never activated, small enough that the surfaces overflow it.</summary>
|
||||
private static Window OffScreen(Window window)
|
||||
{
|
||||
window.Width = 1000;
|
||||
window.Height = 420;
|
||||
window.WindowStartupLocation = WindowStartupLocation.Manual;
|
||||
window.Left = -20000;
|
||||
window.Top = -20000;
|
||||
window.ShowActivated = false;
|
||||
window.ShowInTaskbar = false;
|
||||
return window;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public sealed class SessionDeletionAndOverviewTests
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
public string? PickExecutable(string? initialDirectory = null) => null;
|
||||
}
|
||||
|
||||
/// <summary>The summary windows, counting how often they were asked to close the deleted sessions' ones.</summary>
|
||||
|
||||
@@ -300,8 +300,12 @@ public sealed class SettingsViewModelTests
|
||||
h.Vm.ExceptionsSuspended.Should().BeTrue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The strip says when it applies (beta.18): turned on, a measured session stops at its next safety scan — not "at the next
|
||||
/// session start", which it said until then — and turned off, per-game settings decide from the next session start.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheKillSwitchIsOneSettingsRowAndTheAgentIsToldWhenItReadsIt()
|
||||
public async Task TheKillSwitchIsOneSettingsRowAndTheStripSaysWhenItApplies()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
Harness h = await OpenAsync(s);
|
||||
@@ -312,7 +316,14 @@ public sealed class SettingsViewModelTests
|
||||
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.HookingKillSwitch, Ct)).Should().BeTrue();
|
||||
h.Vm.KillSwitchState.Should().Be(Strings.Settings_KillSwitch_On);
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Settings_Applied, "hooking.kill_switch is an Agent-read key (D16)");
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Settings_KillSwitch_Applied_On, "a measured session stops at its next safety scan");
|
||||
new Application.Capture.CaptureOptions().ScanInterval.Should().Be(TimeSpan.FromSeconds(30), "the strip says within 30 seconds");
|
||||
|
||||
h.Vm.KillSwitch = false;
|
||||
Task off = h.Vm.Pending;
|
||||
await off;
|
||||
|
||||
h.Strip.Shown.Should().HaveCount(2).And.Subject.Last().Body.Should().Be(Strings.Settings_Applied, "hooking.kill_switch is an Agent-read key (D16)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -458,7 +469,7 @@ public sealed class SettingsViewModelTests
|
||||
await h.Vm.HookedGames[0].RevokeCommand.ExecuteAsync(null);
|
||||
|
||||
h.Vm.HookedGames.Should().ContainSingle();
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Shared.Strings.Safety_Consent_AgentUnavailable);
|
||||
h.Strip.Shown.Should().ContainSingle().Which.Body.Should().Be(Strings.Agent_NotConnected_NothingChanged, "turning off changed nothing; \"Nothing was enabled.\" was the enable path's words");
|
||||
h.Vm.ElevationText.Should().Be(Strings.Settings_VkLayer_Unknown, "no HelloAck, no claim");
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Xml.Linq;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.Update;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
using FrameLedger.Shared.Safety;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -111,6 +112,7 @@ public sealed class ViewerModeTests
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "RunElevated, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "StartWithWindows, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "IsChecked", "AutoCheckUpdates, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "SelectedValue", "UpdateChannel, Mode=TwoWay")]
|
||||
[InlineData("Pages/SettingsPage.xaml", "ItemsSource", "ExceptionGames")]
|
||||
public void EveryControlThatAsksTheAgentOrChangesThisPcIsOffInAViewer(string file, string attribute, string binding)
|
||||
{
|
||||
@@ -122,4 +124,32 @@ public sealed class ViewerModeTests
|
||||
|
||||
((string?)control.Attribute("IsEnabled")).Should().Be("{Binding ViewModel.ActsOnThisPc}", $"{file}: {binding}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.18: every setting the Agent reads is off in a viewer, which has no Agent — the exception option and the three
|
||||
/// Recording numbers stayed live, and a change said "Applied. The capture agent reads it at the next session start." The
|
||||
/// registry says which settings the Agent reads, so a new one without its control here turns this red.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EverySettingTheAgentReadsIsOffInAViewer()
|
||||
{
|
||||
Dictionary<string, (string Attribute, string Binding)> controls = new(StringComparer.Ordinal)
|
||||
{
|
||||
[SettingsRegistry.HookingKillSwitch.Key] = ("IsChecked", "KillSwitch, Mode=TwoWay"),
|
||||
[SettingsRegistry.HookingUserModeExceptions.Key] = ("IsChecked", "UserModeExceptions, Mode=TwoWay"),
|
||||
[SettingsRegistry.CaptureRunElevated.Key] = ("IsChecked", "RunElevated, Mode=TwoWay"),
|
||||
[SettingsRegistry.CaptureMinSessionSeconds.Key] = ("Value", "MinSessionSeconds, Mode=TwoWay"),
|
||||
[SettingsRegistry.TelemetryIntervalMs.Key] = ("Value", "TelemetryIntervalMs, Mode=TwoWay"),
|
||||
[SettingsRegistry.RetentionRawSessionsPerGame.Key] = ("Value", "RetentionRawSessions, Mode=TwoWay"),
|
||||
};
|
||||
XDocument xaml = AccessibilityTests.AppXaml().Single(static x => string.Equals(x.File, Path.Combine("Pages", "SettingsPage.xaml"), StringComparison.Ordinal)).Xaml;
|
||||
|
||||
List<string> live = [.. controls
|
||||
.Select(c => (Key: c.Key, Control: xaml.Descendants().Single(e => string.Equals((string?)e.Attribute(c.Value.Attribute), "{Binding ViewModel." + c.Value.Binding + "}", StringComparison.Ordinal))))
|
||||
.Where(static c => !string.Equals((string?)c.Control.Attribute("IsEnabled"), "{Binding ViewModel.ActsOnThisPc}", StringComparison.Ordinal))
|
||||
.Select(static c => c.Key)];
|
||||
|
||||
SettingsRegistry.All.Where(static d => d.AgentReads).Select(static d => d.Key).Should().BeEquivalentTo(controls.Keys, "every setting the Agent reads has its control named here");
|
||||
string.Join(", ", live).Should().BeEmpty("a viewer has no Agent to read them");
|
||||
}
|
||||
}
|
||||
@@ -76,14 +76,31 @@ internal static class Visuals
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs <paramref name="work"/> with the App's theme dictionary swapped for <paramref name="theme"/>, and puts Dark back:
|
||||
/// elements made inside take the theme's resources when they are created.
|
||||
/// Windows' default accent. The App derives its accent resources from the system's at each theme switch; the checks
|
||||
/// derive them from this one colour, so a result does not depend on the machine's personalisation.
|
||||
/// </summary>
|
||||
public static readonly Color DefaultAccent = Color.FromRgb(0x00, 0x78, 0xD4);
|
||||
|
||||
/// <summary>
|
||||
/// Runs <paramref name="work"/> under <paramref name="theme"/> the way the App switches (<c>WpfThemeApplier</c> →
|
||||
/// <c>ApplicationThemeManager.Apply(theme, …, updateAccent: true)</c>): the accent resources derived for the theme from
|
||||
/// <see cref="DefaultAccent"/>, then the theme dictionary swapped. Afterwards the dictionary and the application's own
|
||||
/// resources are put back as they were, so no other check inherits this one's theme. Elements made inside take the
|
||||
/// theme's resources when they are created; elements made before it hear the change, as a shown window does.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The accent is not in the theme dictionaries (WPF UI 4.3.0 writes it into <c>Application.Resources</c>), and the
|
||||
/// test application's only accent is <c>Accent.xaml</c>'s default, the dark theme's: before 2026-10-07 a check under
|
||||
/// Light measured a link in the dark theme's light blue on the light window, 1.9:1, a colour the App never shows.
|
||||
/// </remarks>
|
||||
public static T UnderTheme<T>(ApplicationTheme theme, Func<T> work)
|
||||
{
|
||||
System.Collections.ObjectModel.Collection<ResourceDictionary> merged = System.Windows.Application.Current.Resources.MergedDictionaries;
|
||||
ResourceDictionary resources = System.Windows.Application.Current.Resources;
|
||||
System.Collections.ObjectModel.Collection<ResourceDictionary> merged = resources.MergedDictionaries;
|
||||
int index = merged.ToList().FindIndex(static d => d is ThemesDictionary);
|
||||
ResourceDictionary original = merged[index];
|
||||
Dictionary<object, object> own = resources.Keys.Cast<object>().ToDictionary(static k => k, k => resources[k]);
|
||||
ApplicationAccentColorManager.Apply(DefaultAccent, theme);
|
||||
merged[index] = new ThemesDictionary { Theme = theme };
|
||||
try
|
||||
{
|
||||
@@ -92,6 +109,15 @@ internal static class Visuals
|
||||
finally
|
||||
{
|
||||
merged[index] = original;
|
||||
foreach (object added in resources.Keys.Cast<object>().Where(k => !own.ContainsKey(k)).ToList())
|
||||
{
|
||||
resources.Remove(added);
|
||||
}
|
||||
|
||||
foreach ((object key, object value) in own.Where(kv => !ReferenceEquals(resources[kv.Key], kv.Value)))
|
||||
{
|
||||
resources[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,15 @@ public sealed class DetectionSweepTests
|
||||
// Unity rules only here: the sweep's second read is StaticGameDetector's, pinned in StaticGameDetectorTests.
|
||||
public ValueTask<UnrealBuildFacts?> ReadUnrealBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult<UnrealBuildFacts?>(null);
|
||||
|
||||
public ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult<UnityBuildFacts?>(null);
|
||||
|
||||
public ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult<GodotBuildFacts?>(null);
|
||||
|
||||
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult<RpgMakerBuildFacts?>(null);
|
||||
}
|
||||
|
||||
private sealed class FakeIdentity : IExecutableIdentitySource
|
||||
|
||||
@@ -129,6 +129,72 @@ public sealed class LibraryImporterTests
|
||||
log.Should().Contain(static l => l.Contains("added Cyberpunk 2077", StringComparison.Ordinal) && l.Contains("hooking off", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.19: the owner's library holds A Doll's Locket - Remake at the helper an earlier import took from butler's
|
||||
/// verdict. This build guesses the NW.js runtime instead — and without matching the store's own id it would offer the
|
||||
/// same game a second time beside the entry the owner already has (and re-points with Change executable…).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AStoreTitleAlreadyInTheLibraryAtAnotherExecutableIsNotOfferedAgain()
|
||||
{
|
||||
var games = new FakeGameRepository();
|
||||
var identity = new FakeIdentity();
|
||||
var locator = new FakeLocator();
|
||||
List<string> log = [];
|
||||
const string install = @"D:\another\it\a-dolls-locket-remake";
|
||||
const string helper = @"D:\ANOTHER\IT\A-DOLLS-LOCKET-REMAKE\DOLLS LOCKET\NOTIFICATION_HELPER.EXE";
|
||||
GameRow old = await games.EnsureAsync(new ExecutableFingerprint { ExePath = helper, SizeBytes = 7, MtimeUnixMs = 7 }, "A Doll's Locket - Remake", Ct);
|
||||
await games.ApplyStoreMetadataAsync(old.Id, new StoreMetadata { Platform = "itch", StoreId = "5085165" }, Ct);
|
||||
identity.Existing.Add(helper);
|
||||
identity.Existing.Add(@"D:\ANOTHER\IT\A-DOLLS-LOCKET-REMAKE\DOLLS LOCKET\CSS\GAME.EXE");
|
||||
locator.Guesses[install] = install + @"\Dolls Locket\css\Game.exe";
|
||||
var itch = new ScriptedStore("itch",
|
||||
new StoreGame("itch", "5085165", "A Doll's Locket - Remake", install, null, null),
|
||||
new StoreGame("itch", "1659887", "Plethora of Bullets 2", @"D:\another\it\plethora-of-bullets-2", @"D:\another\it\plethora-of-bullets-2\POB2.exe", null));
|
||||
identity.Existing.Add(@"D:\ANOTHER\IT\PLETHORA-OF-BULLETS-2\POB2.EXE");
|
||||
var importer = new LibraryImporter([itch], games, identity, locator, log.Add);
|
||||
|
||||
IReadOnlyList<ImportCandidate> found = await importer.DiscoverAsync(Ct);
|
||||
|
||||
ImportCandidate dolls = found.Single(static c => string.Equals(c.Game.StoreId, "5085165", StringComparison.Ordinal));
|
||||
dolls.AlreadyInLibrary.Should().BeTrue("the same itch title is an entry already, at the executable an earlier import chose");
|
||||
dolls.CanImport.Should().BeFalse();
|
||||
found.Single(static c => string.Equals(c.Game.StoreId, "1659887", StringComparison.Ordinal)).CanImport.Should().BeTrue("another title of the same store is not matched");
|
||||
log.Should().Contain(l => l.Contains("already in the library as " + helper, StringComparison.Ordinal));
|
||||
|
||||
(await importer.ImportAsync([.. found.Where(static c => c.CanImport)], Ct)).Added.Should().Be(1);
|
||||
games.Rows.Should().HaveCount(2, "Plethora was added and A Doll's Locket stayed one entry");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The entry's platform is the detection sweep's to refresh — an itch build that ships Steam's API reads as Steam — so the
|
||||
/// same store id with the entry's executable inside the title's install folder is the same title too; outside it, an id
|
||||
/// under another platform is another store's numbering, not this game.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheSameStoreIdInsideTheTitlesFolderIsTheSameTitleWhateverThePlatformReadsAs()
|
||||
{
|
||||
var games = new FakeGameRepository();
|
||||
var identity = new FakeIdentity();
|
||||
var locator = new FakeLocator();
|
||||
const string install = @"D:\another\it\some-game";
|
||||
const string old = @"D:\ANOTHER\IT\SOME-GAME\NOTIFICATION_HELPER.EXE";
|
||||
GameRow entry = await games.EnsureAsync(new ExecutableFingerprint { ExePath = old, SizeBytes = 7, MtimeUnixMs = 7 }, "Some Game", Ct);
|
||||
await games.ApplyStoreMetadataAsync(entry.Id, new StoreMetadata { Platform = "steam", StoreId = "42" }, Ct);
|
||||
identity.Existing.Add(@"D:\ANOTHER\IT\SOME-GAME\GAME.EXE");
|
||||
locator.Guesses[install] = install + @"\Game.exe";
|
||||
identity.Existing.Add(@"D:\ANOTHER\IT\OTHER\OTHER.EXE");
|
||||
locator.Guesses[@"D:\another\it\other"] = @"D:\another\it\other\Other.exe";
|
||||
var itch = new ScriptedStore("itch",
|
||||
new StoreGame("itch", "42", "Some Game", install, null, null),
|
||||
new StoreGame("itch", "42", "Another store's 42", @"D:\another\it\other", null, null));
|
||||
|
||||
IReadOnlyList<ImportCandidate> found = await new LibraryImporter([itch], games, identity, locator, static _ => { }).DiscoverAsync(Ct);
|
||||
|
||||
found.Single(static c => string.Equals(c.Game.Name, "Some Game", StringComparison.Ordinal)).AlreadyInLibrary.Should().BeTrue("its entry's executable is inside the title's folder");
|
||||
found.Single(static c => string.Equals(c.Game.Name, "Another store's 42", StringComparison.Ordinal)).CanImport.Should().BeTrue("the same number under another platform, elsewhere, is not this title");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AStoreThatThrowsCostsItsOwnTitlesAndTheSameExecutableUnderTwoStoresIsOneRow()
|
||||
{
|
||||
|
||||
@@ -162,26 +162,33 @@ public sealed class RecordedSessionEventsTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// §S23-3 (beta.13): the events carry the guard's own reason when it named a family, so the App can say a service or a
|
||||
/// driver was found on the PC — and nothing when the guard named nothing (the kill switch, a block already on the row).
|
||||
/// The events carry the guard's own reason whenever it refused: beside a family since §S23-3 (beta.13), so the App can say
|
||||
/// a service or a driver was found on the PC, and beside none since beta.18, so a refusal no family names is said in the
|
||||
/// guard's words — not as the end's name, "reason RefusedByGuard", nor its signal as a finding. Nothing when no verdict
|
||||
/// refused (a process that could not be opened is the loop's, not the guard's).
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BothSafetyEventsCarryTheGuardsReasonWhenItNamedAFamily()
|
||||
public void BothSafetyEventsCarryTheGuardsReasonWheneverItRefused()
|
||||
{
|
||||
var pipe = new RecordingPublisher();
|
||||
RecordedSession service = Session(SessionEndReason.RefusedByGuard, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedService, "Easy Anti-Cheat", "EasyAntiCheat_EOS"), tier: CaptureTier.NotHooked);
|
||||
RecordedSession wow64 = Session(SessionEndReason.RefusedByGuard, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
verdict: AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.TargetIsWow64, string.Empty, "target is a WOW64 process"), tier: CaptureTier.NotHooked);
|
||||
RecordedSession unreadable = Session(SessionEndReason.TargetUnreadable, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
tier: CaptureTier.NotHooked);
|
||||
RecordedSession driver = Session(SessionEndReason.SafetyUnhook, ExitStatus.UnhookedSafety, new FinalizeOutcome(FinalizeStatus.Saved, 9, 0),
|
||||
verdict: AntiCheatVerdict.Refused(AntiCheatRefusalReason.BlockedDriver, "Riot Vanguard", "vgk.sys"));
|
||||
RecordedSession killSwitch = Session(SessionEndReason.RefusedKillSwitch, ExitStatus.Normal, new FinalizeOutcome(FinalizeStatus.Discarded, null, 0),
|
||||
tier: CaptureTier.NotHooked);
|
||||
RecordedSession rescan = Session(SessionEndReason.SafetyUnhook, ExitStatus.UnhookedSafety, new FinalizeOutcome(FinalizeStatus.Saved, 10, 0),
|
||||
verdict: AntiCheatVerdict.FromNative((int)AntiCheatRefusalReason.ProcessUnreadable, string.Empty, "Access is denied."));
|
||||
|
||||
RecordedSessionEvents.PublishAll(pipe, service, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, driver, _info);
|
||||
RecordedSessionEvents.PublishAll(pipe, killSwitch, _info);
|
||||
foreach (RecordedSession session in new[] { service, wow64, unreadable, driver, rescan })
|
||||
{
|
||||
RecordedSessionEvents.PublishAll(pipe, session, _info);
|
||||
}
|
||||
|
||||
pipe.Of<CaptureRefusedEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedService", null);
|
||||
pipe.Of<SafetyUnhookEvent>().Single().GuardReason.Should().Be("BlockedDriver");
|
||||
pipe.Of<CaptureRefusedEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedService", "TargetIsWow64", null);
|
||||
pipe.Of<SafetyUnhookEvent>().Select(static e => e.GuardReason).Should().Equal("BlockedDriver", "ProcessUnreadable");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -41,6 +41,33 @@ public sealed class StaticGameDetectorTests
|
||||
UnrealReads++;
|
||||
return ValueTask.FromResult(unreal);
|
||||
}
|
||||
|
||||
public UnityBuildFacts? Unity { get; init; }
|
||||
|
||||
public GodotBuildFacts? Godot { get; init; }
|
||||
|
||||
public RpgMakerBuildFacts? RpgMaker { get; init; }
|
||||
|
||||
/// <summary>Which of the beta.19 second reads was made, in order.</summary>
|
||||
public List<string> BuildReads { get; } = [];
|
||||
|
||||
public ValueTask<UnityBuildFacts?> ReadUnityBuildAsync(GameFileSnapshot s, CancellationToken ct = default)
|
||||
{
|
||||
BuildReads.Add("unity");
|
||||
return ValueTask.FromResult(Unity);
|
||||
}
|
||||
|
||||
public ValueTask<GodotBuildFacts?> ReadGodotBuildAsync(GameFileSnapshot s, CancellationToken ct = default)
|
||||
{
|
||||
BuildReads.Add("godot");
|
||||
return ValueTask.FromResult(Godot);
|
||||
}
|
||||
|
||||
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot s, CancellationToken ct = default)
|
||||
{
|
||||
BuildReads.Add("rpgmaker");
|
||||
return ValueTask.FromResult(RpgMaker);
|
||||
}
|
||||
}
|
||||
|
||||
private static SignalGroup Any(params string[] globs) => new()
|
||||
@@ -249,6 +276,55 @@ public sealed class StaticGameDetectorTests
|
||||
probe.UnrealReads.Should().Be(0);
|
||||
}
|
||||
|
||||
private static DetectionRuleSet BuildRules() => Rules() with
|
||||
{
|
||||
Engines =
|
||||
[
|
||||
new EngineRule { Id = "unity", Name = "Unity", Signals = Any("UnityPlayer.dll"), Version = new VersionExtractor { Type = VersionExtractorType.UnityBuild } },
|
||||
new EngineRule { Id = "rpgmaker_mv", Name = "RPG Maker MV/MZ", Signals = Any("nw.dll"), Version = new VersionExtractor { Type = VersionExtractorType.RpgMakerBuild } },
|
||||
new EngineRule { Id = "godot", Name = "Godot", Signals = Any("*.pck"), Version = new VersionExtractor { Type = VersionExtractorType.GodotBuild } },
|
||||
],
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// beta.19: Unity, Godot and RPG Maker decide their versions in code as Unreal does — one second read, for the engine that
|
||||
/// matched only, and the decider's witness reported (the owner's Dialoop, 衔蝶 and A Doll's Locket - Remake as measured).
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData("UnityPlayer.dll", "unity", "6000.3.3f1", EngineVersionSource.UnityPlayer)]
|
||||
[InlineData("xiandie.pck", "godot", "4.4.1", EngineVersionSource.GodotPack)]
|
||||
[InlineData("css/nw.dll", "rpgmaker", "1.10.0", EngineVersionSource.RpgMakerMzCore)]
|
||||
public async Task UnityGodotAndRpgMakerReadTheirBuildFactsOnceForTheEngineThatMatched(string marker, string read, string version, string source)
|
||||
{
|
||||
var probe = new ScriptedProbe(Snapshot(marker))
|
||||
{
|
||||
Unity = new UnityBuildFacts { PlayerProductVersion = "6000.3.3f1 (ef04196de0d6)", PlayerFileVersion = [6000, 3, 3, 15664153] },
|
||||
Godot = new GodotBuildFacts { PackVersion = [4, 4, 1], ExeProductName = "xiandie", ExeProductVersion = "0.1.0.3" },
|
||||
RpgMaker = new RpgMakerBuildFacts { CoreScript = "rmmz_core.js", CoreScriptVersion = "1.10.0" },
|
||||
};
|
||||
var detector = new StaticGameDetector(new ScriptedRules(BuildRules()), probe);
|
||||
|
||||
StaticDetectionResult r = await detector.DetectAsync(@"C:\Games\Example\Game.exe", TestContext.Current.CancellationToken);
|
||||
|
||||
r.EngineVersion.Should().Be(version);
|
||||
r.EngineVersionSource.Should().Be(source);
|
||||
probe.BuildReads.Should().Equal([read], "one read, for the matched engine only");
|
||||
probe.UnrealReads.Should().Be(0);
|
||||
}
|
||||
|
||||
/// <summary>A build read that found nothing is no version and no witness — never the old rules' raw file version.</summary>
|
||||
[Fact]
|
||||
public async Task ABuildReadWithNoFactsHasNoVersion()
|
||||
{
|
||||
var detector = new StaticGameDetector(new ScriptedRules(BuildRules()), new ScriptedProbe(Snapshot("UnityPlayer.dll")));
|
||||
|
||||
StaticDetectionResult r = await detector.DetectAsync(@"C:\Games\Example\Game.exe", TestContext.Current.CancellationToken);
|
||||
|
||||
r.EngineId.Should().Be("unity");
|
||||
r.EngineVersion.Should().BeNull();
|
||||
r.EngineVersionSource.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ItRejectsAnEmptyExePathRatherThanProbingNothing()
|
||||
{
|
||||
|
||||
@@ -39,11 +39,10 @@ namespace FrameLedger.CaptureHost.Tests;
|
||||
/// machine, so the record's path is pinned too.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Category=Integration, and CI will not run it.</b> §S19(b): the guard refuses a
|
||||
/// .NET test host that has loaded a <c>protect</c>-matching module, measured on CI.
|
||||
/// On this dev box the guard allows it, so these are dev-box-reproducible and
|
||||
/// merge-gate-absent — the same split <c>ShmDrainIntegrationTests</c> lives with, and
|
||||
/// stated rather than implied.
|
||||
/// <b>Category=Integration — and CI runs it.</b> This paragraph said CI would not (corrected 2026-10-07): §S19(b), the
|
||||
/// guard refusing a .NET test host that had loaded a <c>protect</c>-matching module, was answered on 2026-09-06 by the
|
||||
/// signer check, and <c>./build.ps1 check</c> runs the Integration category on CI since (<c>13_CI_CD</c> §ci.yml). A green
|
||||
/// CI is evidence for this suite, and a race in it fails a merge: two did on 2026-10-07 (the two cases below that say so).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[Trait("Category", "Integration")]
|
||||
@@ -454,13 +453,26 @@ public sealed class CaptureHostEndToEndTests : IDisposable
|
||||
// P1 item 3, from OUTSIDE the process: the host launches the harness in its Vulkan mode with the
|
||||
// layer's environment, the guard passes and injects nothing (TargetIsVulkanLayered), and the
|
||||
// records come from the layer's ring. Skipped honestly where there is no Vulkan loader or no
|
||||
// presentable device -- the harness says so with exit 77, which the session reports as
|
||||
// LaunchTargetExited before any ring existed.
|
||||
// presentable device -- the harness says so itself, with exit 77 and a "[SKIP]" line.
|
||||
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "vulkan-1.dll")))
|
||||
{
|
||||
Assert.Skip("no Vulkan loader on this machine");
|
||||
}
|
||||
|
||||
// ASKED BEFORE THE HOST RUNS, of the harness itself (beta.18). This used to be read off the host's run: its output
|
||||
// for the harness's "[SKIP]" line, or the session's LaunchTargetExited. Neither holds on a hosted runner, which has
|
||||
// the loader and no device. The runner is elevated, so the host starts the harness through CreateProcessWithTokenW
|
||||
// (UnelevatedProcess), which hands the child no stdout -- the line never reached the host's output -- and the
|
||||
// harness's exit races the guard's poll: #288's CI run scanned it while it died and ended RefusedByGuard
|
||||
// (ModuleScanFailed, "a module list came back incomplete"), failing where it should have skipped. Run directly, the
|
||||
// harness's own output and exit code are this test's; and once it HAS presented here, every failure below is real.
|
||||
(int probeExit, string probeOutput) = await ProbeVulkanAsync();
|
||||
if (probeExit == 77)
|
||||
{
|
||||
Assert.Skip("the harness found no presentable Vulkan device on this machine: " + probeOutput);
|
||||
}
|
||||
|
||||
probeExit.Should().Be(0, "the harness presents through Vulkan on this machine, or says why it cannot: " + probeOutput);
|
||||
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
using Process host = StartHost("launch", "--exe", ConsentedExecutable, "--args", "--vulkan --hold-presenting 8",
|
||||
@@ -470,16 +482,6 @@ public sealed class CaptureHostEndToEndTests : IDisposable
|
||||
await host.WaitForExitAsync(TestContext.Current.CancellationToken);
|
||||
stdout += "\n---- stderr ----\n" + await stderrTask + $"\n---- exit {host.ExitCode} ----\n";
|
||||
|
||||
// The harness says so itself (exit 77, a "[SKIP]" line on the shared console) when this
|
||||
// machine has a loader but no device -- a hosted runner's shape. Its exit races the guard's
|
||||
// poll, so the session may read LaunchTargetExited or, if it died under the scan, whatever
|
||||
// the scan could not read; the harness's own line is the signal that does not race.
|
||||
if (stdout.Contains("[SKIP]", StringComparison.Ordinal)
|
||||
|| stdout.Contains(nameof(SessionEndReason.LaunchTargetExited), StringComparison.Ordinal))
|
||||
{
|
||||
Assert.Skip("the harness found no presentable Vulkan device on this machine: " + stdout);
|
||||
}
|
||||
|
||||
stdout.Should().Contain("vulkan layer: ", "the launch names the manifest it wrote and the enable-list entry");
|
||||
stdout.Should().Contain("capture side: the Vulkan implicit layer", stdout);
|
||||
stdout.Should().Contain("apiMask=0x8", "FL_API_VULKAN is bit 3; the ring is the layer's, not an Overlay's");
|
||||
@@ -487,6 +489,34 @@ public sealed class CaptureHostEndToEndTests : IDisposable
|
||||
host.ExitCode.Should().Be(0, stdout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The plain harness asked to present through Vulkan for a second, under its own name — never the consented copy, whose
|
||||
/// name the host resolves its target by — with its output and exit code read here: 77 and a "[SKIP]" line where this
|
||||
/// machine cannot, 0 where it can. Bounded: a driver that hangs is a failure to report, not a test that never ends.
|
||||
/// </summary>
|
||||
private static async Task<(int ExitCode, string Output)> ProbeVulkanAsync()
|
||||
{
|
||||
using var probe = Process.Start(new ProcessStartInfo(Harness, "--vulkan --hold-presenting 1")
|
||||
{
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
})!;
|
||||
using var bound = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
|
||||
bound.CancelAfter(TimeSpan.FromSeconds(60));
|
||||
try
|
||||
{
|
||||
string output = await probe.StandardOutput.ReadToEndAsync(bound.Token).ConfigureAwait(false);
|
||||
await probe.WaitForExitAsync(bound.Token).ConfigureAwait(false);
|
||||
return (probe.ExitCode, output);
|
||||
}
|
||||
catch (OperationCanceledException e) when (!TestContext.Current.CancellationToken.IsCancellationRequested)
|
||||
{
|
||||
probe.Kill(entireProcessTree: true);
|
||||
throw new TimeoutException("hook-harness --vulkan --hold-presenting 1 did not end within 60 s", e);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WhenTheTargetExitsTheHostStopsAndSaysWhy()
|
||||
{
|
||||
@@ -494,7 +524,11 @@ public sealed class CaptureHostEndToEndTests : IDisposable
|
||||
// DLL_PROCESS_DETACH teardown — so this can only come from the held process handle.
|
||||
(await GrantConsentAsync()).Should().Be(ConsentWriteOutcome.Written);
|
||||
|
||||
Process harness = StartHarness("--real --hold-presenting 6");
|
||||
// 15 s, not 6 (beta.18): the host resolves its target once, as it starts, and on a loaded runner a host that took
|
||||
// longer than the hold found the harness gone and ended TargetNotRunning — #286's first CI run, as on 2026-09-21
|
||||
// and before. The host prints nothing until its session ends, so there is no "attached" to wait for; the hold is
|
||||
// the margin, and the case's run time with it.
|
||||
Process harness = StartHarness("--real --hold-presenting 15");
|
||||
Process? host = null;
|
||||
try
|
||||
{
|
||||
|
||||
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user