Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddba1a4b87 | ||
|
|
42fe25da6a | ||
|
|
c4e47868dd | ||
|
|
c48b1348a7 | ||
|
|
0e03d07dac | ||
|
|
5ab297b7b7 |
No files matched your search
@@ -27,6 +27,98 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.1.0-beta.11] - 2026-10-03
|
||||
|
||||
**The eleventh pre-release: a user-mode anti-cheat exception that can be reached, a library that fills the window, and
|
||||
charts and clean-up across a game's sessions.** The same unsigned installer: verify its hash against `SHA256SUMS.txt`,
|
||||
then *More info → Run anyway*. What changed for a user:
|
||||
|
||||
- **The user-mode anti-cheat exception no longer needs earlier sessions.** A game blocked the moment it was added could
|
||||
never qualify; now its first two sessions under the exception are a trial, and one that does not go well ends the
|
||||
exception for good. Everything else it requires is unchanged, and a ban remains possible.
|
||||
- **The Games library** fills the window at any width, can be shown as a list, counts its games and has **Refresh**: it
|
||||
reads the library again, offers the games your stores installed since, and marks games whose executable is gone.
|
||||
- **Import** hides the games already in the library — you can show them, dimmed.
|
||||
- **Delete all sessions** — of one game on its page, or of every game in Settings ▸ Data.
|
||||
- **Charts across a game's sessions**: *Sessions at a glance* on the Sessions tab, and the Trend draws more metrics at once.
|
||||
- **Settings** has no row without a control.
|
||||
- **Three CrackProof games** are on the anti-cheat list (Umamusume: Pretty Derby, Heaven Burns Red, Madoka Magica Magia
|
||||
Exedra).
|
||||
- **The Disclaimer (2.9) and the EULA (1.4) say how the exception works now**, so the Legal Gate opens once after the
|
||||
update. The Privacy Policy is unchanged.
|
||||
|
||||
**Updating from `0.1.0-beta.10`:**
|
||||
|
||||
- Quit the App (tray icon → Exit) and end `FrameLedger.Agent.exe` before running the installer.
|
||||
- Schema 0017 adds one column; the database opens in place, and an older version cannot open it again.
|
||||
- Every game is re-checked once for anti-cheat (rules `2026.10.1`).
|
||||
- An exception made under beta.9 or beta.10 stays in force; if fewer than two sessions were played under it, the rest of
|
||||
its trial applies.
|
||||
|
||||
### Added
|
||||
|
||||
- **The Games library fills the window, switches to a list, counts its games and refreshes** (owner requests, beta.11).
|
||||
The cards were 300 px in a plain wrap, so a wide window left up to a card's width empty at the right and the third pill
|
||||
("Hooking off") was cut; the grid now has as many columns as fit at 300 px or wider, every card an equal share of the
|
||||
width, and the pills wrap. A button beside the sort switches to a **list** — one row per game with its store, engine,
|
||||
status, sessions, playtime and last played — and the choice is remembered (`ui.library_view`). The title counts the
|
||||
games. **Refresh** reads the library again, looks in the stores for games installed since and offers only those (*No
|
||||
new games* when there are none), and marks every entry whose executable is gone **Not installed** — the tooltip says
|
||||
when it is the drive that is not connected; nothing is removed. The page also reloads by itself when a session ends or
|
||||
an import adds games while it is open (an import made from the menu used to show only after leaving the page).
|
||||
|
||||
- **Import hides the games already in the library** (owner request, beta.11): on a re-import they were most of the list
|
||||
and pushed the new ones out of sight. *Show the N games already in the library* brings them back, dimmed, and a row
|
||||
that cannot be imported has its box disabled (a tick on it was taken and ignored).
|
||||
|
||||
- **Delete all sessions** (owner decision D40, beta.11): on a game's page, every session of that game; in Settings ▸
|
||||
**Data**, every session of every game — with their frame and sensor data and notes, after a confirmation that says how
|
||||
many. The library, the settings and every game's hooking consent stay. The capture agent deletes them (the rows are its)
|
||||
and refuses while a session is being recorded; an older agent is told to restart. A summary window still open on a
|
||||
deleted session closes. A new pipe request, `DeleteSessions`.
|
||||
|
||||
- **Charts across a game's sessions** (owner decision D39, beta.11): the Sessions tab opens with *Sessions at a glance* —
|
||||
every hooked session's frame rate (Presented FPS, or Native and Displayed where frame generation was measured, never one
|
||||
inflated line) and its 1% and 0.1% lows, oldest first; click a point to select that session. The Trend keeps its metric
|
||||
and can **draw more beside it** (*Also draw*), a second unit against the right axis, two units at most.
|
||||
|
||||
- **Three CrackProof titles on the anti-cheat title list** (owner request, beta.11): Umamusume: Pretty Derby (Steam
|
||||
`3224770`), Heaven Burns Red (`1973710`) and Madoka Magica Magia Exedra (`2987800`). Each store page states *"Uses
|
||||
Kernel Level Anti-Cheat"* and names HyperTech's CrackProof; its driver loads from `System32` under a numbered name,
|
||||
outside the game's folder, so nothing of the game's own can name it and the list does, by Steam id only (no executable
|
||||
name was verified). ANOTHER EDEN, which a community list also names, is left out: its store page says nothing of the
|
||||
kind. Rules `2026.10.1` — every game is re-checked once, and these games' hooking is turned off like any title-list
|
||||
finding, never under a user-mode exception (`19_SAFETY` check 3).
|
||||
|
||||
### Changed
|
||||
|
||||
- **The user-mode anti-cheat exception no longer needs sessions measured before it — its first two sessions are a
|
||||
trial** (owner decision D38, beta.11). D33 asked for two successful hooked sessions before a grant, but since beta.8 a
|
||||
game is blocked the moment it is added, so a blocked game could never earn them, and a reset ledger lost the ones it
|
||||
had: after the owner deleted theirs, GIRLS' FRONTLINE 2 read *"Not eligible: 0 successful hooked session(s), two are
|
||||
needed"* for good. A grant now needs no session. Until two sessions under it have succeeded, the game page says
|
||||
*trial: N of 2*, and any end during the trial — a crash, a safety unhook, the Overlay's own stop, a new finding, or a
|
||||
stored hooked session that recorded no frame or did not end normally — ends the exception **for good** (schema 0017,
|
||||
`games.ac_exception_trial_failed_at`, set once and never cleared; the Agent refuses a grant with `TrialFailed` and the
|
||||
store refuses one in SQL; a twin merge keeps the mark). Every other condition is unchanged — one user-mode family, no
|
||||
`.sys` in the game's folder, no title list — and after the trial an end is what it was. The disclosure is
|
||||
`ac-exception-dialog/2`: it names no session count and has a *Trial* paragraph (`ja` stays English until reviewed).
|
||||
**Legal text:** Disclaimer 2.9 (§2A) and EULA 1.4, so the Legal Gate opens once; the accuracy block, `SECURITY.md` and
|
||||
`LIMITATIONS.md` say the same; CLAUDE.md rule 2 carries the amendment (`19_SAFETY` §The user-mode exception).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Settings has no row without a control** (owner request, beta.11): *Games with hooking on* shows only while a game has
|
||||
hooking on, the *Elevation* row became the admin mode row's status line, and the note under the language row is gone.
|
||||
The retention message now names Settings ▸ Recording, where retention lives.
|
||||
|
||||
- **The exception's card and list say what is true** (found with D38): an eligible game's *Anti-cheat* card said hooking
|
||||
"cannot be turned on" beside a usable *Make exception…* — it now says hooking is off unless you make one; the Settings
|
||||
list showed each game's session count twice and listed games that could never qualify, with no action — it lists only
|
||||
games it can act on; a tolerant scan that found nothing of the family was said as "the check could not finish" — it
|
||||
says the family was not found; and a blocked game whose executable could not be read stayed *Checking…* for ever — the
|
||||
sweep now answers it. **Refresh** shows only while a row is being checked, the one time it can change anything.
|
||||
|
||||
## [0.1.0-beta.10] - 2026-09-28
|
||||
|
||||
**The tenth pre-release: how each game was shown, the agent as administrator if you choose it, and the exact Unreal
|
||||
|
||||
@@ -17,6 +17,7 @@ A C++ DLL (`FrameLedger.Overlay.dll`) is injected into games the user explicitly
|
||||
>
|
||||
> **A finding turns the game's hooking off** (`19_SAFETY` §What a finding does to the game). An anti-cheat named in the game itself — its process, its title lists, its folder — is written to the row exactly as the pre-scan always wrote it (`hook_enabled = 0`, `hook_blocked_reason`, `hook_prescan_state = 'blocked'`), and since 2026-09-22 also when the guard finds it at a session's start or at the 30 s re-scan (`AntiCheatVerdict.IsFindingAboutTheGame`). A machine-wide driver or service refuses that session only. The notice, the game's page, the session's notes and the Agent's log all say it happened. Nothing clears the block, as before.
|
||||
> **Amended 2026-09-26 (owner decision D33): one narrow, evidence-bound exception.** Asked with the 2026-09-22 withdrawal and this rule quoted back, the owner chose a per-game exception for anti-cheat that is **user-mode throughout** — a Settings option off by default, then the user ticks each eligible game through a versioned disclosure (bans are possible and can arrive days later). Eligible only when every finding about the game is `BlockedModule` / `AntiCheatFile` / `AntiCheatDirectory` of ONE family whose floor-and-file footprint has no driver, service or `.sys` (`fl::guard::FamilyIsUserModeOnly` — the GUARD decides, from a family NAME the caller passes), no `.sys` is anywhere in the install tree, no title list names the game, and the ledger holds ≥ 2 successful Tier-1 sessions of it. Drivers, services, title lists, the `.sys` rule, the fuzzy tier, scan failures, `TargetUnreadable`, 32-bit, the kill switch and Vulkan are never excepted. The guard runs every check and keeps scanning past the tolerated family (`kAllowedUserModeException`, reason 28); the Overlay learns the family from `Local\FrameLedger.Tolerate.<pid>` before its loader detour exists. A new finding, a crash / safety unhook / floor stop under it, or an executable change ends it; the block is never cleared. **No other form of override is to be added** (`19_SAFETY` §The user-mode exception).
|
||||
> **Amended 2026-10-03 (owner decision D38): the evidence moved from before the grant to its trial.** "≥ 2 successful Tier-1 sessions" above could never be met by a game blocked at add time — since beta.8 that is every blocked game — nor after a ledger reset. Asked with that, the owner chose: a grant needs no session; the first two hooked sessions under it are a trial, and any end during the trial (a crash, a safety unhook, a floor stop, a new finding, or a stored hooked session with no frames or an abnormal exit) ends the exception **for good** (`games.ac_exception_trial_failed_at`, schema 0017, never cleared). Every other condition above is unchanged, and so is the last sentence.
|
||||
3. **Never implement evasion.** No manual mapping, no PE header erasure, no thread hiding, no signature obfuscation, no unlinking from the PEB module list. Injection uses documented `LoadLibraryW`. The DLL keeps its real name, real exports, and version info. A performance tool must be *visible* to anti-cheat, not hidden from it. Any PR that makes FrameLedger harder to detect is rejected on principle.
|
||||
4. **Never read or write game memory outside our own hooks.** We read arguments passed to APIs we hooked and COM/handle objects we legitimately own. No pattern scanning for game internals, no reading player/entity state, no writing to game memory. Ever.
|
||||
5. **The hook must never crash the game.** Every hook body: SEH-guarded, allocation-free, lock-free, no logging, no exceptions crossing the boundary. On repeated faults, self-disable (`17_HOOK_ENGINE` §Fault policy).
|
||||
|
||||
+4
-3
@@ -5,14 +5,15 @@ 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.10.*
|
||||
*Beta software: this page describes version 0.1.0-beta.11.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
- **Games with anti-cheat.** FrameLedger looks for anti-cheat before it touches a game and refuses when it
|
||||
finds one — there is no switch that overrides this. The one exception is an anti-cheat that runs entirely
|
||||
inside the game (no driver, no service), which you can allow per game after a warning and two good
|
||||
sessions; a ban is still possible and may come days later. Kernel anti-cheat is never allowed.
|
||||
inside the game (no driver, no service), which you can allow per game after a warning; its first two
|
||||
sessions are a trial, and one that does not go well ends the exception for good. A ban is still possible and
|
||||
may come days later. Kernel anti-cheat is never allowed.
|
||||
([Safety](docs/19_SAFETY_AND_ANTICHEAT.md))
|
||||
- **Anti-cheat FrameLedger does not know about.** The list of anti-cheat products is FrameLedger's own and
|
||||
can be incomplete. A game protected by something unknown may be hooked; that is a risk to your account
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
> No telemetry. No accounts. All data stays on your machine.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), 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
|
||||
@@ -78,8 +78,8 @@
|
||||
> game in the library, before injection, at a session's start or by the 30 s re-check; the game's page says so,
|
||||
> and nothing turns it back on for that executable — except a user-mode exception you make yourself, per game,
|
||||
> in Settings (off by default): only where the only finding is one anti-cheat that runs entirely in user mode, with
|
||||
> no driver file in the game's folder, on a game already measured successfully at least twice. The guard still
|
||||
> runs every check under it and ends it on anything new; a ban remains possible.
|
||||
> no driver file in the game's folder. Its first two sessions are a trial, and one that does not go well ends it
|
||||
> for good. The guard still runs every check under it and ends it on anything new; a ban remains possible.
|
||||
>
|
||||
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
|
||||
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
|
||||
@@ -152,7 +152,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.10` (2026-09-28); before it `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.11` (2026-10-03); before it `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**.
|
||||
@@ -180,4 +180,4 @@ If you find a game with anti-cheat that FrameLedger fails to detect, please open
|
||||
|
||||
---
|
||||
|
||||
**Status:** pre-release (beta). Ten 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). Eleven 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.
|
||||
+4
-2
@@ -37,8 +37,10 @@ check. The grant is a record in your own database, like the consent stamp; what
|
||||
decides itself which family it may let through. So these are security reports too: the guard letting through a family
|
||||
that has a driver, a service or a `.sys` in the floor or the rules; an exception applying to a game with a kernel
|
||||
driver in its folder, on a title list, or with a second anti-cheat; the Agent writing a grant on a pipe message
|
||||
without its own tolerant pre-scan and session count; an exception that survives a new finding, a crash or safety stop
|
||||
under it, or a changed executable; and the Overlay tolerating a family the guard did not.
|
||||
without its own tolerant pre-scan; an exception that survives a new finding, a crash or safety stop under it, or a
|
||||
changed executable; since 0.1.0-beta.11 (D38), an exception that survives a session during its two-session trial that
|
||||
did not go well, and any grant written for a game whose earlier exception failed its trial; and the Overlay tolerating
|
||||
a family the guard did not.
|
||||
|
||||
## Running the agent as administrator
|
||||
|
||||
|
||||
+4
-2
@@ -10,6 +10,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable.
|
||||
- FR-1.4 Remove game (asks whether to keep or delete its sessions).
|
||||
- FR-1.5 "Supports" row shows shipped-capability hints (DLSS/FSR/XeSS/FG) — visually distinct from measured per-session values (`05_DETECTION` §Capability hints).
|
||||
- FR-1.7 Delete all sessions (beta.11, owner decision D40): of one game from its page, or of every game from Settings ▸ Data, after a confirmation that says how many — with their frame and sensor series and notes; the library, the settings and every consent stay. The Agent deletes them (the rows are its, `06_DATA_MODEL` §Writer ownership) and refuses while a session it would delete under is being recorded.
|
||||
- FR-1.6 Recording switch per entry (2026-09-23, HANDOFF D29): off, the program is not watched at all — no session, no measurement, no injection — and a session of it that is running stops. On by default; entries an old import made for Steam's own tools start with it off. The library card says "Not recorded".
|
||||
|
||||
### FR-2 Hooking consent & control (new, safety-critical — see `19_SAFETY`)
|
||||
@@ -18,7 +19,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- FR-2.3 The runtime guard refuses injection and refuses to continue a session when anti-cheat is detected. **No override exists anywhere in the UI, config, or CLI.** *(Since 2026-09-26 one narrow, evidence-bound exception exists — FR-2.8. It is not an override: the guard still runs every check and decides itself which anti-cheat family it may let through.)*
|
||||
- FR-2.4 Global "disable all hooking" kill switch in Settings; also honored by the Vulkan layer.
|
||||
- FR-2.7 (owner decision 2026-09-22; it was a per-game override for one day, withdrawn) A finding about a game — anti-cheat named in its process, on its title lists or in its folder — turns hooking off for that game wherever the guard makes it: at the pre-scan, at a session's start, at the 30 s re-scan, or (since 2026-09-25) at the Agent's pre-scan of the library. The row carries the reason, the game's page and the notice say so, and nothing overrides it (`19_SAFETY` §What a finding does to the game).
|
||||
- FR-2.8 (owner decision D33, 2026-09-26) **The user-mode anti-cheat exception.** A Settings option, off by default, lets the user grant a per-game exception to a game whose only anti-cheat findings are ONE family that is user-mode throughout (no driver, service or `.sys` in the floor or the rules), whose install tree holds no `.sys`, which is on no title list, and which FrameLedger has measured hooked at least twice (successful Tier-1 sessions). The Agent computes that eligibility itself; the user grants each game through a versioned disclosure that states the ban risk; hooking is then turned on through FR-2.1's dialog as ever. Machine-wide drivers and services, title lists, kernel drivers in the game folder, the fuzzy tier, a scan that could not finish, an unreadable process, a 32-bit game, the kill switch and Vulkan are never excepted. A new finding, a crash / safety unhook / Overlay stop under it, or a changed executable ends it; the option off suspends it; the block itself is never cleared and stays shown (FR-2.2). Sessions under it are marked with the family (`19_SAFETY` §The user-mode exception).
|
||||
- FR-2.8 (owner decision D33, 2026-09-26) **The user-mode anti-cheat exception.** A Settings option, off by default, lets the user grant a per-game exception to a game whose only anti-cheat findings are ONE family that is user-mode throughout (no driver, service or `.sys` in the floor or the rules), whose install tree holds no `.sys`, which is on no title list, ~~and which FrameLedger has measured hooked at least twice (successful Tier-1 sessions)~~ and no exception of which ever ended during its trial (D38, 2026-10-03: a grant needs no session; its first two hooked sessions are a trial, and an end during the trial — any end below, or a stored hooked session with no frames or an abnormal exit — ends it for good, `games.ac_exception_trial_failed_at`). The Agent computes that eligibility itself; the user grants each game through a versioned disclosure that states the ban risk; hooking is then turned on through FR-2.1's dialog as ever. Machine-wide drivers and services, title lists, kernel drivers in the game folder, the fuzzy tier, a scan that could not finish, an unreadable process, a 32-bit game, the kill switch and Vulkan are never excepted. A new finding, a crash / safety unhook / Overlay stop under it, or a changed executable ends it; the option off suspends it; the block itself is never cleared and stays shown (FR-2.2). Sessions under it are marked with the family (`19_SAFETY` §The user-mode exception).
|
||||
- FR-2.5 Repeated crashes shortly after injection auto-disable hooking for that game, with an explanation and a manual re-enable path.
|
||||
- FR-2.6 Users can always see, per session, which tier produced the data.
|
||||
|
||||
@@ -55,6 +56,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
- FR-6.1 Sessions table per game: date, duration, tier badge, Native, Displayed, FG×, lows, resolution + upscaler, RT/PT/RR chips, crash badge, tags.
|
||||
- FR-6.2 Compare 2–5 sessions; **mixed-tier comparisons require explicit acknowledgement** and are marked on the chart.
|
||||
- FR-6.3 Hardware snapshot per session; trend charts mark changes ("GPU driver 572.16 → 576.02").
|
||||
- FR-6.6 Charts across a game's sessions (beta.11, owner decision D39): the Sessions tab opens with an overview of every hooked session's rate and lows (Presented FPS, or Native and Displayed where frame generation was measured; 1% and 0.1% lows), a click selecting the session; and the Trend draws more metrics beside the selected one, two units at most (the second against the right axis).
|
||||
- FR-6.4 Sessions with mid-session settings changes are excluded from trends by default, with a toggle.
|
||||
- FR-6.5 Session tags and notes.
|
||||
|
||||
@@ -79,7 +81,7 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
|
||||
> **beta.10 (D34):** "Agent elevation (optional — explains what it unlocks)" is the admin mode — *Run the agent as
|
||||
> administrator*, off by default, a disclosure before it turns on, Windows' prompt at every Agent start (`01_ARCHITECTURE`
|
||||
> ADR-9, `08_UI` §Settings).
|
||||
Language (en/vi/ja), theme, start with Windows, minimize to tray, background capture, **global hooking kill switch**, min session length, telemetry interval, retention, Agent elevation (optional — explains what it unlocks), Vulkan layer registration state, update channel, online metadata opt-in, reopen legal documents.
|
||||
Language (en/vi/ja), theme, start with Windows, minimize to tray, background capture, **global hooking kill switch**, min session length, telemetry interval, retention, Agent elevation (optional — explains what it unlocks), Vulkan layer registration state, update channel, online metadata opt-in, reopen legal documents. **beta.11 (owner request 2026-10-03: no row without a control):** Delete all sessions (FR-1.7, a *Data* section); the elevation state is a line of the admin mode's own row, not a row of its own; the hook-enabled list shows only while a game has hooking on; the language row carries no separate note.
|
||||
|
||||
### FR-11 Legal Gate
|
||||
First run blocks until the user accepts EULA, GPLv3 notice, Disclaimer, Privacy Policy. Re-shown when a document version increments. The injection risk is stated in the Disclaimer *and* repeated at per-game consent (FR-2.1) — once is not enough for something that can cost an account.
|
||||
|
||||
+18
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
`%LOCALAPPDATA%\FrameLedger\ledger.db`. Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, `busy_timeout=5000`. `Microsoft.Data.Sqlite` + Dapper; all writes in explicit transactions.
|
||||
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It is the one Agent write that deletes a `games` row; it never touches a consent column. **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; never a `hook_*` column), `session_annotations` (tags, notes, and since schema 0002 the FR-8.3 overrides — which is WHY they are on this table and not on `sessions`), `settings`, `legal_acceptance`. Both read everything. The ports say the same in their names: `IGameRepository.UpdateMetadataAsync` / `SetTriStateDefaultAsync` / `RemoveAsync`, `ISessionAnnotationRepository`, `RegisteredSettings`, `ILegalAcceptanceStore.RecordAsync` (all P3 PR-3).
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It is the one Agent write that deletes a `games` row; it never touches a consent column. **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; never a `hook_*` column), `session_annotations` (tags, notes, and since schema 0002 the FR-8.3 overrides — which is WHY they are on this table and not on `sessions`), `settings`, `legal_acceptance`. Both read everything. The ports say the same in their names: `IGameRepository.UpdateMetadataAsync` / `SetTriStateDefaultAsync` / `RemoveAsync`, `ISessionAnnotationRepository`, `RegisteredSettings`, `ILegalAcceptanceStore.RecordAsync` (all P3 PR-3).
|
||||
|
||||
## Schema (v2 — hook architecture)
|
||||
|
||||
@@ -69,7 +69,7 @@ CREATE TABLE games (
|
||||
-- schema 0014 (2026-09-26, D33): the user-mode anti-cheat exception, a layer OVER hook_blocked_reason, never its clearing
|
||||
ac_exception_eligible INTEGER NOT NULL DEFAULT 0, -- the Agent's sweep: the exception may be granted now
|
||||
ac_exception_verdict TEXT, -- its tolerant pre-scan, Reason|Family|Signal; NULL = nothing asked
|
||||
ac_exception_sessions INTEGER NOT NULL DEFAULT 0, -- successful Tier-1 sessions counted
|
||||
ac_exception_sessions INTEGER NOT NULL DEFAULT 0, -- D38: successful sessions under the grant in force (its trial)
|
||||
ac_exception_checked_rules_version TEXT, -- the key the verdict was reached under: rules, executable size and
|
||||
ac_exception_checked_exe_size_bytes INTEGER, -- mtime, and the block text itself
|
||||
ac_exception_checked_exe_mtime_ms INTEGER,
|
||||
@@ -81,7 +81,9 @@ CREATE TABLE games (
|
||||
ac_exception_exe_mtime_ms INTEGER,
|
||||
ac_exception_lapsed_at INTEGER, -- when and why the last grant ended (UserModeExceptionLapse:
|
||||
ac_exception_lapsed_reason TEXT, -- Withdrawn|ExecutableChanged|NoLongerEligible|NewFinding|
|
||||
-- SafetyUnhook|OverlayStopped|SessionCrashed)
|
||||
-- SafetyUnhook|OverlayStopped|SessionCrashed|TrialFailed)
|
||||
-- schema 0017 (2026-10-03, D38): an exception of this game ended during its trial — for good; never cleared
|
||||
ac_exception_trial_failed_at INTEGER,
|
||||
hook_autodisabled_reason TEXT, -- set after repeated crashes
|
||||
hook_crash_count INTEGER NOT NULL DEFAULT 0,
|
||||
capability_flags TEXT, -- JSON: what the game SHIPS — never a measurement. Since P4 PR-1 (2026-09-14) a JSON
|
||||
@@ -389,6 +391,7 @@ switch's rule); integers are invariant-culture within an inclusive range; choice
|
||||
| `ui.minimize_to_tray` | bool | `0` | | UI (PR-8) |
|
||||
| `ui.hide_anticheat_hooking` | bool | `1` | | UI (beta.8, 2026-09-25): the game page of an entry the guard found anti-cheat in shows the finding in place of its Hooking card (`08_UI` §Game detail) |
|
||||
| `ui.fps_decimals` | bool | `0` | | UI (beta.8, 2026-09-25): every FPS figure with two decimals ("62.40") instead of a whole number |
|
||||
| `ui.library_view` | choice `grid`\|`list` | `grid` | | UI (beta.11, 2026-10-03): the Games library as a grid of cards that fills the width, or as a list; written by the page's own switch, no Settings row (`08_UI` §Games) |
|
||||
| `capture.background` | bool | `1` | | Agent |
|
||||
| `hooking.kill_switch` | bool | `0` | | Agent (FR-2.4, since P2 PR-F) |
|
||||
| `hooking.usermode_ac_exceptions` | bool | `0` | | Agent, at every session start and command (FR-2.8, D33, 2026-09-26): off suspends every user-mode exception without deleting any; on, the user still grants each eligible game |
|
||||
@@ -577,6 +580,18 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
|
||||
> 16; `LedgerDatabaseTests.ScriptSixteenAddsTheDisplayColumnsAndAnEarlierSessionHasNone`,
|
||||
> `SqliteSessionRepositoryTests.ASessionRoundTripsColumnForColumn`.
|
||||
|
||||
> **`0017_exception_trial.sql` (beta.11, 2026-10-03, owner decision D38) — the exception's trial.** One column,
|
||||
> `games.ac_exception_trial_failed_at`: when an exception of the game ended during its trial (`19_SAFETY` §The user-mode
|
||||
> exception), NULL when none did. ADD COLUMN only, no data change: a grant made under D33 stays in force and carries no
|
||||
> mark. Written by the Agent's revoke only (`IGameConsentStore.RevokeAntiCheatExceptionAsync(…, trialFailed)`), set once
|
||||
> (`COALESCE`), cleared by nothing — not by `ChangeExecutableAsync`, which does not name it — and carried by a twin merge
|
||||
> (the earlier of two). The store applies it in SQL: no eligibility is written as eligible and no grant is written over
|
||||
> it. `ac_exception_sessions` (0014) changes meaning without a script: since D38 it is the trial's progress under the grant
|
||||
> in force, which the sweep rewrites on its first pass. `LatestVersion` is 17;
|
||||
> `LedgerDatabaseTests.ScriptSeventeenAddsTheTrialMarkAndChangesNoRow`,
|
||||
> `SqliteGameConsentStoreTests.AnEndDuringTheTrialMarksTheGameAndNothingClearsIt`,
|
||||
> `SqliteGameMergeTests.AFailedExceptionTrialOnEitherTwinMarksTheSurvivor`.
|
||||
|
||||
> **Every open used to migrate, and one that should not have did — 2026-09-16.** The Agent's `--console sessions`,
|
||||
> a verb that prints, was run against the owner's ledger while the file on disk was at schema 2 and applied 0003 and
|
||||
> 0004 to it. `LedgerDatabase.OpenReadOnlyAsync` exists since that day: an existing file, `PRAGMA query_only`, no
|
||||
|
||||
+2
-1
@@ -391,11 +391,12 @@ Unchanged in spirit from v1, bumped to `v2` for the new message set.
|
||||
| `SetWatchlist` | UI→A | `{ entries: [{ gameId?, exePath }] }` — ~~full replace~~ **ensure, never remove** (built 2026-09-13, PR-1b): each entry's path is normalised by the Agent, its row ensured with hooking OFF when new, and the ack is `WatchlistAck { games: [{ gameId, exePath, name }], unreadable: [exePath] }`; `gameId` in a request is a hint and never trusted over the path. UI re-sends on connect. **Carries no hooking state** (see §The pipe is not a trust boundary). *Since the App writes `games` rows itself under `06_DATA_MODEL` §Writer ownership (HANDOFF §P3 D15), this is the pipe's way of adding a row, not the only one; the watcher reads the table at 1 Hz either way.* |
|
||||
| `LaunchGame` | UI→A | `{ gameId, arguments? }` → ~~suspended-launch~~ launch mode as built ("inject late", `04_CAPTURE` §Launch mode) → `LaunchAck { gameId, accepted, outcome, sessionGuid? }` — `outcome` is `Accepted` · `UnknownGame` · `SessionRunning` (one per game at a time) · `Unavailable` · `RecordingOff` (2026-09-23: the entry's recording switch is off, FR-1.6 — FrameLedger does not start what it will not record). *(Built 2026-09-13, PR-1b: `CaptureOrchestrator.LaunchAsync` over an `ILaunchRecorderFactory` the Agent composes with the Vulkan layer's environment — or none when FR-2.4's switch is on — and the launcher election runs after, as the console's `launch` does; the elected session is not addressable by the launch's guid.)* |
|
||||
| `SetHookEnabled` | UI→A | `{ gameId, enabled, disclosureVersion? }` — Agent re-runs the static AC pre-scan and may reply `Refused`. **The Agent stamps the consent timestamp itself.** *(Built 2026-09-13, PR-1b, as far as it can be: `enabled: false` → `RevokeAsync` → `HookEnabledAck { gameId, enabled: false, outcome }`; `enabled: true` → the pre-scan of the executable's directory, a refusal or a "could not verify" recorded through `RecordGuardBlockAsync` and answered `Refused { gameId, reason, family?, signal? }`; a clean scan → ~~**`Error DisclosureUnavailable`, nothing stamped** — the reviewed FR-2.1 text does not exist, and a client's `disclosureVersion` is a claim, not a disclosure shown. PR-4 replaces that last branch with the stamp~~ **since PR-4 (2026-09-13): the client's `disclosureVersion` compared with the Agent's own `SafetyDisclosure.Version`; equal → the stamp from the Agent's clock with `ConsentProvenance.ConsentDialog`, answered `HookEnabledAck { enabled, outcome, prescan: "clean" }`; anything else → `Error DisclosureVersionMismatch`, nothing written (D14). `DisclosureUnavailable` remains for a composition that wired no version, which `--serve` never is.)* **Since beta.8 (2026-09-25):** the pre-scan is of the executable (the guard resolves the install root, PR-2 of that train), and BEFORE it an executable known not to run as x64 is answered `Refused { gameId, reason: "ExecutableNotX64", signal: "x86" | "anycpu32" | "arm64" | "arm" }` with nothing scanned and nothing written — not a guard reason and not a block (`05_DETECTION` §What the files say about themselves). **Since D33 (2026-09-26):** for a blocked game whose user-mode exception is in force for the executable on disk (the option on, a grant made on these bytes, the block naming that family) the pre-scan NAMES the family, and a pass under it is stamped as ever and answered `prescan: "exception"`; a finding about the game under it also ends the exception. |
|
||||
| `SetAntiCheatException` | UI→A | **Added 2026-09-26 (D33).** `{ gameId, enabled, disclosureVersion? }` — grant or withdraw a game's user-mode anti-cheat exception (`19_SAFETY` §The user-mode exception). `enabled: false` → the exception ends (`Withdrawn`), hooking goes off while the block stands → `AntiCheatExceptionAck { gameId, granted: false, outcome, family? }`. `enabled: true` → `Error DisclosureVersionMismatch` unless `disclosureVersion` is the Agent's `AntiCheatExceptionDisclosure.Version`; `Error ExceptionsOff` while `hooking.usermode_ac_exceptions` is off; `Refused { reason: "BlockNotExceptionable" }` for a title list or an unreadable block; then the Agent's OWN facts — a tolerant pre-scan of the executable on disk naming the block's family (`Refused { reason, family, signal }` unless the guard let exactly that family through) and the successful Tier-1 sessions (`Refused { reason: "TooFewSessions", signal: <count> }` under two) — and the store writes the grant only over facts that make the game eligible → `AntiCheatExceptionAck { granted, outcome, family }`. **A grant turns nothing on**: hooking is FR-2.1's `SetHookEnabled`, afterwards. Not answered (`UnknownType`) by an Agent composed without the exception. |
|
||||
| `SetAntiCheatException` | UI→A | **Added 2026-09-26 (D33).** `{ gameId, enabled, disclosureVersion? }` — grant or withdraw a game's user-mode anti-cheat exception (`19_SAFETY` §The user-mode exception). `enabled: false` → the exception ends (`Withdrawn`), hooking goes off while the block stands → `AntiCheatExceptionAck { gameId, granted: false, outcome, family? }`. `enabled: true` → `Error DisclosureVersionMismatch` unless `disclosureVersion` is the Agent's `AntiCheatExceptionDisclosure.Version`; `Error ExceptionsOff` while `hooking.usermode_ac_exceptions` is off; `Refused { reason: "BlockNotExceptionable" }` for a title list or an unreadable block; then the Agent's OWN facts — ~~the successful Tier-1 sessions (`Refused { reason: "TooFewSessions", signal: <count> }` under two)~~ *(D38, 2026-10-03: no session is needed)*; a game an exception of which ended during its trial is refused before anything is scanned (`Refused { reason: "TrialFailed", family, signal: <unix ms> }`); a tolerant pre-scan of the executable on disk naming the block's family (`Refused { reason, family, signal }` unless the guard let exactly that family through) — and the store writes the grant only over facts that make the game eligible, and never over a failed trial → `AntiCheatExceptionAck { granted, outcome, family }`. **A grant turns nothing on**: hooking is FR-2.1's `SetHookEnabled`, afterwards. Not answered (`UnknownType`) by an Agent composed without the exception. |
|
||||
| `PauseCapture` / `ResumeCapture` | UI→A | global → `PauseAck { paused }`; `StatusAck.paused` reports it. *(Built 2026-09-13, PR-1b: one in-memory flag, `CapturePause`, read by every session loop at its tick and told to the ring once per transition; supervision — the guard scan, the kill switch, the safety stop — never pauses. Not persisted: an Agent that restarts resumes.)* |
|
||||
| `StopSession` | UI→A | `{ sessionGuid }` — graceful ~~unhook~~ stop + finalize → `StopAck { sessionGuid, accepted, reason? }`. *(Built 2026-09-13, PR-1b: the orchestrator names every session it starts and cancels THAT session's stop token; the loop reads it at its next tick, drains once more, and ends as `SessionEndReason.StoppedByUser` — `exit_status = normal`, the row stored like any other, the target left running. A guid nobody runs is `accepted: false`. Distinct from the host's cancellation, which leaves a `.partial`.)* |
|
||||
| `UpdateRules` | UI→A | **no payload** — a trigger, not a source. The Agent re-reads only its own `%LOCALAPPDATA%\FrameLedger\rules\` copy → `UpdateRulesAck { outcome }`. *(Built 2026-09-13, PR-1b: the seeder's `EnsureSeededAsync` outcome; a payload naming a path is ignored, and a test sends one to prove it.)* |
|
||||
| `Shutdown` | UI→A | graceful stop → `ShutdownAck`, then the host stops (sessions finalize inside its grace window). *(Built 2026-09-13, PR-1b: `IAgentLifetime`, the host's under `--serve`, a logged no-op under `--console`.)* |
|
||||
| `DeleteSessions` | UI→A | **Added 2026-10-03 (beta.11, D40).** `{ gameId? }` — every session of that game, or of every game when it is null, with their segments, frame and sensor series and annotations (they cascade) → `DeleteSessionsAck { gameId?, games, sessions }`. `Error SessionRunning` and nothing deleted while a session of that game — of any game, for all — is being recorded (`CaptureOrchestrator.IsRecording` / `IsRecordingAny`). The client names no rows beyond the game: they are the Agent's (§Writer ownership). Additive: an older Agent answers `Error UnknownType`, which the App says as "restart the agent". Carries no safety fact. |
|
||||
| `SweepRetention` | UI→A | **no payload** — a trigger, like `UpdateRules`: the Agent applies `06_DATA_MODEL` §Retention to every game with the `retention.raw_sessions_per_game` it reads itself → `SweepRetentionAck { keep, games, sessions }` (`keep` 0 = unlimited, and then nothing was swept). *(Built 2026-09-15, P4 PR-7, for Tools ▸ Database maintenance: `Application.Recording.RetentionSweep` over `ISessionRepository.SweepRetentionAllAsync`, composed into `AgentCommandHandler` under `--serve`. The client names no number because the rows are the Agent's (§Writer ownership). Additive: an older Agent answers `Error UnknownType`, which the dialog reads as "restart the Agent". Carries no safety fact.)* |
|
||||
| `SessionStarted` | A→UI | `{ sessionGuid, gameId, gameName, pid, tier, startedAt, hold? }` — **published once per session**: at the attach (tier 1, `startedAt` the attach), or — **since 2026-09-23** — at the first tick of a session held unhooked (tier 2, `startedAt` the session's start, `pid` 0 when the loop never opened the process, as a hooking-off hold never does). ~~a session that never attaches has no `SessionStarted`, only its `SessionCompleted` (tier 2)~~ — that was the beta.5 wire, and every hooking-off, refused or unreadable game read "Nothing is being captured." for as long as it ran. **`hold` (optional, tier 2 only)** is why nothing is measured: `{ reason, guardReason?, family?, signal?, hookingTurnedOff }` — the loop's `SessionEndReason` and, when the guard said anything but allow, its reason, family and signal: the same words the row's `capture_notes` will carry, so the live card and the summary read one sentence (`Formats.Tier2HoldReason` / `Tier2Reason`). The refusal's own event (`CaptureRefused` and the rest, below) goes out with this start rather than when the game exits, and is not repeated at the end |
|
||||
| `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? }` — how long it has run and the machine's sensors. **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) |
|
||||
|
||||
@@ -175,6 +175,25 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
|
||||
### Games (grid → detail)
|
||||
- `GridView`-style panel of cover cards (`ui:CardAction`): name, platform badge, engine badge, total playtime, last played, mini trend sparkline (avg Native FPS last 10 sessions). Sort/filter/`ui:AutoSuggestBox` search.
|
||||
> **The library, beta.11 (owner requests 2026-10-03).** *The empty band on the right:* the cards were 300 px in a plain
|
||||
> `WrapPanel`, so at ~1350 px three fitted and a card's width was left unused; the grid is now
|
||||
> `Controls.UniformWrapPanel` — as many columns as fit at 300 px or wider, every card an equal share of the width, each row
|
||||
> as tall as its tallest card — and the pill row wraps instead of cutting its last pill. **Grid or list** (owner's choice:
|
||||
> switch between the two): the button beside the sort shows the other view; the list is one row per game (name, store,
|
||||
> engine, status, sessions, played, last played; double-click or Enter opens it), and the choice is `ui.library_view`.
|
||||
> **The count** is in the title (*Games · 42*). **Refresh** reads the library again, then asks the stores for games installed
|
||||
> since (`ImportLibraryFlow.RunAsync(onlyNew: true)`: *No new games* and no checklist when there are none), and every entry
|
||||
> whose executable is not on disk carries a **Not installed** pill — its tooltip is the game page's own sentence for it,
|
||||
> the drive that is not connected or the path the file is gone from (`GameLibrary.ExecutableExists` and
|
||||
> `Formats.ExecutableMissingText`, asked off the UI thread on every listing, never stored; nothing is removed for it). **The page reloads by itself** while it is on screen when a session ends (`SessionCompleted`) or an
|
||||
> import adds games (`LibraryChanges` — navigating to the page already on screen does nothing in WPF UI 4.3.0, so an
|
||||
> import from the menu never showed until the page was left). **Import** (FR-1.2): the games already in the library — at
|
||||
> this path or under another drive letter — are hidden by default (*Show the N games already in the library* brings them
|
||||
> back, dimmed), and a row that cannot be imported has its box disabled; the XAML comment said "cannot be ticked" while a
|
||||
> tick was taken and ignored. Tests: `GamesViewModelTests`, `ImportLibraryFlowTests.RefreshOffersOnlyNewGamesAndSaysWhenThereAreNone`,
|
||||
> `…GamesAlreadyInTheLibraryAreHiddenUntilAskedFor`, `PagesLoadTests.TheLibraryGridFillsItsWidthAndTheListViewReplacesIt`,
|
||||
> `…TheImportChecklistRendersWithTheExistingRowsShown`.
|
||||
>
|
||||
- **Game detail:**
|
||||
- Header: cover, name, publisher, version, platform, engine+version, API + Present Mode of last session, `FpsReadout` (lifetime avg), TriState chips, Edit button.
|
||||
- **Two clearly separated rows** (`05_DETECTION` §Capability hints — conflating these was the old design's core mistake):
|
||||
@@ -228,6 +247,16 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> blocked row: its one action could only be refused. Tests: `GameDetailViewModelTests` (hidden, shown, the card
|
||||
> pill), `BlockedReasonTextTests`, `PagesLoadTests.AnAntiCheatGamesPageRendersTheFindingInPlaceOfTheHookingCard`.
|
||||
>
|
||||
> **D38 (2026-10-03, beta.11): the trial.** *Not eligible: N successful hooked session(s), two are needed* is gone — a
|
||||
> grant needs no session. The card reads *Exception in force since … — trial: N of 2 good sessions so far* until the
|
||||
> trial is over, *Not eligible: an exception of this game ended during its trial on …, so none can be made again* after
|
||||
> a failed one, and *Not eligible now: {family} was not found in the game's folder when it was checked* where the
|
||||
> tolerant scan found nothing of the family (it used to say the check "could not finish"). The **Anti-cheat** card of an
|
||||
> eligible game says hooking is off *unless you make a user-mode exception for it (below)* — "cannot be turned on" beside
|
||||
> a usable *Make exception…* contradicted itself. The disclosure (`ac-exception-dialog/2`) names no session count and
|
||||
> has a **Trial** paragraph. Tests: `GameDetailViewModelTests.WhyAGameIsNotEligibleIsSaidOnItsPage`,
|
||||
> `SettingsViewModelTests.TheExceptionOptionIsOffByDefaultAndItsListFollowsTheAgentsColumns`, `AntiCheatExceptionsTests`.
|
||||
>
|
||||
> **The user-mode exception (2026-09-26, beta.9, owner decision D33).** While Settings' option is on, a blocked
|
||||
> game's page shows a **User-mode exception** card with the Agent's answer about it (`Services.ExceptionView` over
|
||||
> `GameRow.AcException` — the App reads those columns and writes none): *Eligible — no exception made* with **Make
|
||||
@@ -264,6 +293,19 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
3. **Distribution** — FPS histogram + percentile curve of selected session(s).
|
||||
4. **Trend** — metric-over-date line (selector: Native avg / Displayed avg / 1% Low / 0.1% Low / max GPU temp), vertical **hardware-change markers** with tooltip "GPU driver 572.16 → 576.02" (FR-6.3).
|
||||
|
||||
> **Across sessions, beta.11 (owner decision D39, FR-6.6).** The **Sessions** tab opens with *Sessions at a glance*: a
|
||||
> `TrendChart` of every hooked session's Presented FPS (sessions that counted no generated frame), Native and Displayed
|
||||
> (sessions where frame generation was measured — rule 6, never one inflated line) and 1% / 0.1% lows, oldest first,
|
||||
> partial sessions hollow (`TrendSeriesBuilder.Overview`); a click near a session's points selects it in the grid and
|
||||
> scrolls to it (`TrendChart.SessionClicked`). Under it, **Delete all sessions…** (FR-1.7) for this game. The **Trend**
|
||||
> keeps its selector and adds *Also draw*: any other metric ticked is drawn on the same chart, its unit
|
||||
> (`TrendSeriesBuilder.UnitOf`: FPS, °C, %, W, MB, ×) on the left axis when it is the selected metric's and on the right
|
||||
> when it is a second one (marked ▸ in the legend); a metric in a third unit cannot be ticked, and when the selected
|
||||
> metric changes to a third unit only the first ticked unit in the list stays ticked, so every ticked box has its line;
|
||||
> the selected metric is not offered beside itself. One line alone keeps its name on the axis, as before. After any delete — here or in
|
||||
> Settings — a summary window still open on a deleted session closes, and File ▸ Export lets go of it (`SessionDeletion`;
|
||||
> ids are reused once the newest is gone). Tests: `SessionDeletionAndOverviewTests`.
|
||||
>
|
||||
> **The display mode, beta.10 (FR-7.4, `03_METRICS` §Display mode).** The **Last session measured** row adds how that
|
||||
> session was shown — the mode that lasted longest with its share and the window's size (`Display: Borderless 92% ·
|
||||
> 2560×1440`); the **Sessions** tab has a *Display* column for every session, Tier 2 included (the mode shown longest,
|
||||
@@ -435,6 +477,13 @@ Tail view of `ui-*.log` / `agent-*.log` (toggle), level filter, search (`ui:Auto
|
||||
> `PagesLoadTests`.
|
||||
|
||||
### Settings
|
||||
> **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*
|
||||
> card is gone and its state is the third line of *Run the agent as administrator* (its explanation a tooltip on it); the
|
||||
> sentence under the language row is gone. A **Data** section has one row, **Delete all sessions…** (FR-1.7): the
|
||||
> confirmation names how many, the Agent deletes them (`DeleteSessions`), and the strip says what happened or why nothing
|
||||
> was deleted (a session being recorded, no agent, an older agent). Tests: `SettingsViewModelTests.DeleteAllSessionsAsksWithTheTotalThenGoesThroughTheAgent`.
|
||||
|
||||
Sections per FR-10 using the WPF UI settings idiom: `ui:CardControl`/`ui:CardExpander` rows with `ToggleSwitch`, `ComboBox`, `ui:NumberBox` (numeric inputs — min session length, sensor interval, retention). Language switch applies immediately (09_I18N). Theme selector (Light/Dark/System) drives `ApplicationThemeManager` (16 §Theming). **Capture section (top, most important):** the global **hooking kill switch** (`ToggleSwitch`, prominent) with a one-line summary of what it does; a list of games currently hook-enabled with a per-game revoke; Vulkan layer registration state + Register/Unregister; a link to the safety documentation. Turning the global switch off must take effect immediately, including for the Vulkan layer.
|
||||
|
||||
**System (2026-09-21, FR "show the user's hardware"):** a card above Legal stating this PC as a session's hardware snapshot would record it right now — processor, graphics card, graphics driver, memory, Windows build, primary display — through the same `IHardwareSnapshotSource` the Agent stamps sessions with, read on the thread pool when the page opens, a field that could not be read as N/A, with **Copy** (the same lines as text) and a note that nothing is sent anywhere and what CPU temperature needs. Its own `SystemInfoViewModel`, not `SettingsViewModel`'s. The same snapshot is one tertiary line under the session summary's header (it was loaded for the export and shown nowhere), and `--diag` prints it; the bug bundle's `sysinfo.json` is deliberately NOT given it — its keys are the issue link's prefill.
|
||||
@@ -501,6 +550,13 @@ Agent section: elevation state with a plain explanation of what elevation *optio
|
||||
> the option off only kept exceptions are listed, *suspended*. *Checking…* shows until the Agent has answered about
|
||||
> every blocked game, and **Refresh** re-reads the list (the Agent's sweep runs every 15 s). The option is an
|
||||
> Agent-read key and takes effect at the next session start and command.
|
||||
>
|
||||
> **2026-10-03 (beta.11, D38):** the option reads *Allow hooking in games whose only anti-cheat runs in user mode*, and
|
||||
> its body names the trial. The list shows **only rows with an action** — eligible (**Make exception…**) or carrying an
|
||||
> exception (**Withdraw**); "held back only by the session count" is gone with the count, and a game that can never
|
||||
> qualify is explained on its own page. Each row is the game, its finding and its state — the state carries a grant's
|
||||
> trial (*Exception in force since … — trial: 1 of 2 good sessions so far*), so the separate count line that repeated it
|
||||
> is gone. **Refresh** shows only while a row is *Checking…*, the one time it can change anything.
|
||||
|
||||
### First-run flow
|
||||
1. Legal Gate (FR-11): four documents, scrollable, links to GitHub-hosted versions, single Accept.
|
||||
|
||||
@@ -235,12 +235,20 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
|
||||
> be read (a manifest that will not open, more than 4096 of them, a listing error) refuses as `PreScanFailed`. With
|
||||
> nothing listed, nothing is read. Epic has no reader: an Epic install carries no identity to this check.
|
||||
>
|
||||
> **What is listed, and why a title list at all:** 30 Steam app ids and 33 executable names across nine families —
|
||||
> **What is listed, and why a title list at all:** 33 Steam app ids and 33 executable names across ten families —
|
||||
> Valve VAC (CS2, Dota 2, TF2, Deadlock and Valve's older VAC titles), Riot Vanguard, Roblox Hyperion, Blizzard's
|
||||
> online titles ("Blizzard Warden"), Call of Duty (Activision Ricochet), NetEase (Marvel Rivals, NARAKA, FragPunk,
|
||||
> Once Human), ACE (Delta Force, Arena Breakout: Infinite), HoYoverse and EA (Battlefield 2042/6, EA SPORTS FC 25/26).
|
||||
> Once Human), ACE (Delta Force, Arena Breakout: Infinite), HoYoverse and EA (Battlefield 2042/6, EA SPORTS FC 25/26),
|
||||
> and since 2026-10-03 (rules `2026.10.1`, owner's list) HyperTech's **CrackProof** (Umamusume: Pretty Derby
|
||||
> `3224770`, Heaven Burns Red `1973710`, Madoka Magica Magia Exedra `2987800` — Steam ids only: no executable name
|
||||
> was verified, and a guessed one is a false refusal waiting for an unrelated game).
|
||||
> These are the titles whose anti-cheat leaves nothing of the game's own for checks 1, 2 and 4 to find — VAC runs
|
||||
> inside Steam, Blizzard's scanner is built into the game — or whose kernel driver loads only after the checks run.
|
||||
> CrackProof is the second kind: a Proton log of Umamusume shows its driver loaded from `C:\Windows\System32` under a
|
||||
> numbered name (`usrdrv017864.sys`, ValveSoftware/Proton#8853), outside the game's folder, so the `.sys` rule cannot
|
||||
> see it before the first run and no driver token could name it. Each of the three store pages states *"Uses Kernel
|
||||
> Level Anti-Cheat"* and CrackProof (read 2026-10-03); ANOTHER EDEN, which a community list also names, was left out
|
||||
> because its store page says nothing of the kind.
|
||||
> Every app id was checked against its Steam store page; Call of Duty's changed when Activision split CoD HQ, so only
|
||||
> ids with a live store page are listed. The per-title lists are **floored** like the families: a rules file can
|
||||
> add a title and cannot take one off. `rules-validate` refuses a name engines and tools share (`Game.exe`,
|
||||
@@ -475,10 +483,19 @@ unmeasured rule — NetEase Yidun, `AntiCheatFile NEP2.dll` — after FrameLedge
|
||||
normal Tier-1 sessions in the owner's ledger, 474,143 frames). The owner asked for a way to keep measuring a game like
|
||||
that, and chose, against the rule this document had kept since 2026-09-22 and with that rule quoted back to them, **an
|
||||
exception the user grants per game, bound to evidence, and only for anti-cheat that is user-mode throughout.** The
|
||||
reasons D22 withdrew the override are answered one by one: it "did nothing where it was wanted" — an exception is only
|
||||
offered where FrameLedger has already measured the game hooked; it "only exposed the user to the risk its own disclosure
|
||||
described" — that risk stands, and the disclosure says so, including that a ban can arrive days later and that FrameLedger
|
||||
cannot know.
|
||||
reasons D22 withdrew the override are answered one by one: it "did nothing where it was wanted" — ~~an exception is only
|
||||
offered where FrameLedger has already measured the game hooked~~ *(D38 below: the measurement now comes under the grant,
|
||||
as its trial)*; it "only exposed the user to the risk its own disclosure described" — that risk stands, and the disclosure
|
||||
says so, including that a ban can arrive days later and that FrameLedger cannot know.
|
||||
|
||||
> **Amended 2026-10-03 (owner decision D38): the evidence comes after the grant, as a trial.** The owner deleted their
|
||||
> ledger and found *GIRLS' FRONTLINE 2* "Not eligible: 0 successful hooked session(s), two are needed" — for good. The rule
|
||||
> below was a catch-22 for every game it could ever meet again: since beta.8 the library sweep blocks a game the moment
|
||||
> it is added, a blocked game is never hooked without a grant (`CaptureSession` sends it to Tier 2 before the resolver),
|
||||
> so it can never earn the two sessions, and a reset ledger loses the ones it had. D33's evidence was reachable only for a
|
||||
> game measured before its block, and only while those rows lasted. Asked with that, the owner chose: **a grant needs no
|
||||
> session; the first two hooked sessions under it are a trial; any of them that does not go well ends the exception for
|
||||
> good** (`games.ac_exception_trial_failed_at`, schema 0017, which nothing clears). Every other condition is unchanged.
|
||||
|
||||
**What may be excepted — all of it must hold:**
|
||||
|
||||
@@ -491,8 +508,10 @@ cannot know.
|
||||
- no `*.sys` anywhere in the install tree — the kernel-driver rule (D30) is never excepted, whichever family a driver
|
||||
belongs to (so *Aniimo*, which unpacks `NEPKernel.sys` beside `NEP2.dll` on its first run, stays blocked);
|
||||
- the game is on no title list (`BlockedExecutable`, `BlockedStoreId` — the notorious titles are there by design);
|
||||
- the ledger holds **at least two successful Tier-1 sessions** of the game: hooked, frames recorded, `exit_status = normal`
|
||||
(which since beta.8 includes End task's exit code 1 and a user's stop), never crashed, never unhooked for safety.
|
||||
- ~~the ledger holds **at least two successful Tier-1 sessions** of the game: hooked, frames recorded, `exit_status = normal`
|
||||
(which since beta.8 includes End task's exit code 1 and a user's stop), never crashed, never unhooked for safety.~~
|
||||
**Since D38 (2026-10-03): no session is needed** — and no exception of the game has ever ended during its trial
|
||||
(`ac_exception_trial_failed_at` is NULL).
|
||||
|
||||
**Never excepted, whatever the user ticked:** a machine-wide `BlockedDriver` or `BlockedService`, the fuzzy tier
|
||||
(`SuspiciousUnsigned`), a scan that could not look or finish, unusable rules, `TargetUnreadable` (D21), a 32-bit target,
|
||||
@@ -517,6 +536,20 @@ in-process floor stop revokes it; an executable change ends it with the consent
|
||||
the option off suspends every exception. **The block itself is never cleared** — the exception is a separate layer over
|
||||
it, and the finding stays on the game's page (FR-2.2).
|
||||
|
||||
**The trial (D38).** Until two sessions under a grant have succeeded — hooked, stored, frames recorded, `normal`
|
||||
(`ISessionRepository.CountSuccessfulUnderGrantAsync`: under that family, started at or after the grant) — the grant is in
|
||||
its trial, and the App says so ("trial: 1 of 2"). During the trial **any** end of the list above ends the exception
|
||||
**for good**, and so does a stored hooked session that recorded no frame or did not end normally
|
||||
(`UserModeExceptionLapse.TrialFailed`, decided by `UserModeExceptionLapsePolicy` when the recorder stores the row): the
|
||||
end is recorded with its own reason and `ac_exception_trial_failed_at` is set. While it is set the sweep writes the game
|
||||
not eligible, the Agent refuses a grant (`Refused.reason = TrialFailed`, the signal is when) and the store refuses one in
|
||||
SQL; withdrawing, a game update, *Change executable* and a twin merge all keep it. A session too short to be stored, or
|
||||
one that was never hooked, is not judged by its frames or its exit — it neither counts toward the two nor fails the
|
||||
trial that way — but an end of the list above still ends the exception for good during the trial: a crash while
|
||||
hooked, however short, or a finding about the game at the start. After the trial, an end is what it was under
|
||||
D33: the exception may be made again once the sweep finds the game eligible. Deleting sessions can only lengthen a trial
|
||||
— the count is read, never stored as a grant's own fact.
|
||||
|
||||
**What it is not.** Not a bypass of a live refusal, not a global switch (a Settings option off by default enables the list,
|
||||
and the user ticks each game), not reachable from the command line, and not evasion: the DLL stays `LoadLibraryW`-loaded,
|
||||
named and visible (rule 3). `InjectViaLoadLibrary` still has internal linkage in `fl_guard.cpp`; `tools/chokepoint-check.ps1`
|
||||
@@ -531,6 +564,13 @@ option and the list in Settings, the versioned disclosure (`Safety_Exception_*`,
|
||||
game page's exception card and its usable switch under an exception in force, the marks, and the legal text
|
||||
(Disclaimer §2A 2.7, EULA 1.3, the accuracy block, SECURITY.md) — `08_UI` §Games.*
|
||||
|
||||
*D38 in beta.11 (2026-10-03): `UserModeExceptionRules.TrialSessions` replaces `RequiredSessions`; eligibility is the
|
||||
guard's answer and the trial mark; `ac_exception_sessions` is the trial's progress; schema 0017
|
||||
(`ac_exception_trial_failed_at`); `Refused.reason` `TrialFailed` replaces `TooFewSessions`; the disclosure is
|
||||
`ac-exception-dialog/2` (its `Why` names no count, a new `Trial` paragraph); the Settings list shows only games it can act
|
||||
on; and a sweep that cannot read the executable answers "could not verify" instead of leaving the row "checking" for ever.
|
||||
Legal text: Disclaimer §2A 2.9, EULA 1.4, the accuracy block, SECURITY.md, LIMITATIONS.md.*
|
||||
|
||||
|
||||
### The floor data cannot remove
|
||||
|
||||
@@ -681,6 +721,7 @@ normative documentation. Write tokens here exactly as the data must hold them.
|
||||
| Activision Ricochet | `files` | name | `randgrid.sys` | 2026-09-25 |
|
||||
| FredaikisAntiCheat | `directories` | name | `FredaikisAntiCheat` | 2026-09-25 |
|
||||
| **Valve VAC** | — | — | ~~**No data yet** — needs `blockedStoreIds`, whose half of check 3 **cannot be called**~~ **Per-title lists since 2026-09-25** (check 3): 13 Steam app ids and 8 executables, the store half wired. VAC runs inside Steam, so no module, driver or file of the game's own can name it — this row stays a dash on purpose. (**Measured 2026-08-04: a real VAC title returned `Allow`**, `spike-notes.md` §13 — the gap these lists close.) | 2026-09-25 |
|
||||
| **CrackProof** | — | — | **Per-title list since 2026-10-03** (check 3, rules `2026.10.1`): 3 Steam app ids, no executables. Its kernel driver loads from `System32` under a numbered name, so no module, driver or file of the game's own can name it — this row stays a dash on purpose, like VAC's. | 2026-10-03 |
|
||||
|
||||
The "no data yet" rows are deliberately kept rather than deleted. An admitted
|
||||
gap is reviewable; a deleted row is invisible. ~~Activision Ricochet's was one of them~~ — it has data since
|
||||
|
||||
@@ -45,7 +45,9 @@ Rules for this document:
|
||||
> library sweep blocked a game FrameLedger had measured hooked (GIRLS' FRONTLINE 2: EXILIUM, NetEase Yidun `NEP2.dll`),
|
||||
> and the owner chose an evidence-bound, per-game exception for anti-cheat that is user-mode throughout (`19_SAFETY`
|
||||
> §The user-mode exception; CLAUDE.md rule 2's amendment). The two reasons D22 gave are answered: it is offered only
|
||||
> where FrameLedger has already measured the game hooked, and its risk is stated in its own disclosure. **What stays
|
||||
> where FrameLedger has already measured the game hooked, and its risk is stated in its own disclosure. *(2026-10-03,
|
||||
> D38: the first of the two no longer holds as written — a game blocked at add time could never be measured, so the
|
||||
> measurement moved under the grant as a two-session trial whose failure is for good.)* **What stays
|
||||
> open, and is the owner's:** the `ja` text of `Safety_Exception_*`, which ships as English until a reviewer signs;
|
||||
> whether a family the rules file makes kernel-level later should end existing exceptions at once (today it does, at
|
||||
> the sweep's next pass and at every session start); and a real-hardware check that NEP2.dll's load time relative to
|
||||
@@ -104,7 +106,7 @@ or it becomes the next stale status claim this file exists to record.
|
||||
| **S1** | ◐ **launch mode built as "inject late" 2026-09-06 (P1 item 2); the cost is now measured per title** | `FlGuardedInjectWhenReady` polls until a presentation runtime is mapped, then runs the full guard; `dxgiPresentsBeforeHook` and the reported wait are the input the 2026-08-05 deferral lacked. The ruling "inject late vs. no launch mode" is answered by construction — inject late exists — and whether it is *preferred* per title is what the numbers decide |
|
||||
| **S13(c)** | ✅ **salvageable, and salvaged 2026-09-06** | The externally observable proxy the entry proposed is what was built; the missing input is produced by every launched session |
|
||||
| **S19(b)** | 🅓 **deferred, rationale written — and MEASURED** | CI 2026-08-05: the fragment fires on `System.Security.Cryptography.ProtectedData.dll` loaded by a .NET **test host**, i.e. inside a real scan set in the launch-mode arrangement — refusing our own injection. The entry's "plausible and unmeasured" is superseded; the deferral rationale (a `CryptCATAdmin*` PR doing network I/O inside the hard gate, NFR-10) still stands. *(Marked 🔴 until 2026-08-27. The measurement belongs in this cell, not in the marker — a glyph that means "deferred" and a glyph that means "open defect" cannot be the same one in a table audited by counting.)* |
|
||||
| **S14** | ✅ **both halves wired and seeded 2026-09-25** (exe half 2026-08-05) | ~~The store-id half's only in-policy route is P4's platform metadata extractors feeding a guard-side resolver~~ — built as a guard-side seam that reads Steam's `appmanifest_*.acf` and GOG's `goggame-<id>.info` itself; an install no store names is not refused, unreadable store metadata is. 30 Steam ids and 33 executables listed (rules 2026.09.4), floored. Epic has no reader |
|
||||
| **S14** | ✅ **both halves wired and seeded 2026-09-25** (exe half 2026-08-05) | ~~The store-id half's only in-policy route is P4's platform metadata extractors feeding a guard-side resolver~~ — built as a guard-side seam that reads Steam's `appmanifest_*.acf` and GOG's `goggame-<id>.info` itself; an install no store names is not refused, unreadable store metadata is. 30 Steam ids and 33 executables listed (rules 2026.09.4), floored; 33 Steam ids since 2026-10-03 (rules 2026.10.1: three CrackProof titles, `19_SAFETY` check 3). Epic has no reader |
|
||||
| **S23-1** | ✅ **resolved 2026-08-05** | `FlGuardBuildId` gives the Agent a build id of its own, and `ShmHandshakeValidator` performs the comparison `07_IPC` and `04_CAPTURE` both specify. Every refusal path is driven, including **both ids empty** — the shape the feature shipped in, where `"" == ""` reported `Ok` for every process on the machine |
|
||||
| **S23-4** | ✅ **resolved 2026-08-05** | `19_SAFETY` §During a session said "the module scan and the driver scan"; `EvaluateImpl` runs four. Reworded to "every pre-injection check" so it cannot go stale when a check is added, with the two omissions named — `services` is the only tier measured firing on real anti-cheat, and the pre-scan is the only one touching the filesystem |
|
||||
| **S2 part three** | ✅ **built 2026-09-06 (P1 item 3)** | In-layer supervision on the present path, landed with `vkQueuePresentKHR`; `unhookRequested` and the tick deadline both stop the layer (passthrough with the reason on the mapping), proven by a fake loader chain and a 1.5 s test-only flavour of the DLL |
|
||||
|
||||
@@ -1751,6 +1751,58 @@ release.*
|
||||
|
||||
**Owner-only, added to the list below:** item 7.
|
||||
|
||||
## 2026-10-03 — the beta.11 train: the exception's trial, the library, sessions across
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.11]`; this is what no other file carries. The approved plan was five PRs: PR-1 the
|
||||
CrackProof titles (rules `2026.10.1`), PR-2 the exception's trial (schema 0017, Disclaimer 2.9, EULA 1.4), PR-3 the
|
||||
library and the import, PR-4 delete sessions, the charts across sessions and the Settings clean-up, PR-5 the release.*
|
||||
|
||||
**Decisions (owner, 2026-10-03, asked before the plan — do not re-ask):**
|
||||
|
||||
- **D38 — the user-mode exception's evidence moved under the grant, as a trial.** The owner deleted their ledger and
|
||||
found GIRLS' FRONTLINE 2 "Not eligible: 0 successful hooked session(s), two are needed" for good: since beta.8 a game is
|
||||
blocked the moment it is added, a blocked game is never hooked without a grant, so D33's two sessions were unreachable
|
||||
for every game blocked from the start and lost with a reset ledger. Chosen: a grant needs no session; the first two
|
||||
hooked sessions under it are a trial; any end during the trial (every D33 end, or a stored hooked session with no frames
|
||||
or an abnormal exit) ends it for good (`games.ac_exception_trial_failed_at`). Every other condition is unchanged.
|
||||
Legal text: Disclaimer 2.9 (§2A) and EULA 1.4 — the EULA's "a game the Software has already measured successfully"
|
||||
would have become false (D36's rule).
|
||||
- **D39 — charts across a game's sessions: both** — *Sessions at a glance* on the Sessions tab, and *Also draw* on the
|
||||
Trend (two units at most, the second on the right axis).
|
||||
- **D40 — Delete all sessions: both places** — the game's page and Settings ▸ Data. The Agent deletes (the rows are its),
|
||||
never while a session it would delete under is being recorded.
|
||||
- **D41 — Refresh does all three**: reload the library, offer the games the stores installed since, mark the entries
|
||||
whose executable is gone (*Not installed*; nothing is removed).
|
||||
- **D42 — the library switches between a grid that fills the window and a list** (`ui.library_view`).
|
||||
- **CrackProof (owner's list, "a few, by Steam id")**: three titles whose own store pages say *"Uses Kernel Level
|
||||
Anti-Cheat"* and name CrackProof; ANOTHER EDEN, named only by a community list, is left out.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **A fresh git worktree cannot configure the native build**: CMake's MinHook FetchContent clone runs `git submodule`,
|
||||
which fails there ("'submodule' appears to be a git command, but we were not able to execute it"). Run the gate in the
|
||||
primary checkout, whose `build/native/x64-release/_deps` is cached; a worktree is for writing code and managed tests.
|
||||
- **A `DataGrid` laid out outside a window draws its star columns at their minimum** (no Loaded pass): a visual check
|
||||
renders a hosted, off-screen `Window` and pumps the dispatcher (`Dispatcher.PushFrame`), not Measure/Arrange on a page.
|
||||
- **`Native FPS` includes a measured-none session**, whose native rate is the presented one: beside Presented it is a
|
||||
second line on the same points, so the overview keeps Native and Displayed to sessions that generated frames.
|
||||
- **Both processes may change the library while the Games page is open**, and WPF UI 4.3.0 does nothing on a navigation
|
||||
to the page already on screen: the page reloads on `SessionCompleted` and on the App's own `LibraryChanges`.
|
||||
- **A grant's trial is counted from the sessions, not kept as a counter**: the lapse policy counts at each finalize
|
||||
(`CountSuccessfulUnderGrantAsync`: that family, started at or after the grant), and `ac_exception_sessions` is only
|
||||
the sweep's copy for the card. Deleting sessions can only lengthen a trial; the mark that ends one for good
|
||||
(`ac_exception_trial_failed_at`) is the only stored decision.
|
||||
- **A session summary is a window of its own, outside every page**: deleting sessions must close the ones open on a
|
||||
deleted session and let go of File ▸ Export's selection, asking the ledger whether the session is still there (both in
|
||||
`SessionDeletion`, so Settings ▸ Data does it too) — ids are reused once the newest is gone. The plan said so; PR-4's
|
||||
first version did neither, and a self-review caught it before the merge.
|
||||
- **Analyzers met:** `MA0048` (one type per file), `CA1003`/`MA0046` (an `EventArgs` type for an event), `IDE1006` (a `_`
|
||||
prefix on private consts), `CA1030` (no method named `Raise`), `MA0051` (60 lines), and `RevokeAntiCheatExceptionAsync`'s
|
||||
new `bool` before the token turned every `(path, reason, ct)` call into a compile error — pass `ct: ct`.
|
||||
- **The Bash tool's heredocs break on an odd number of apostrophes and halve backslashes**: patch scripts are files.
|
||||
|
||||
**Owner-only, added to the list below:** item 8.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
|
||||
@@ -1793,6 +1845,13 @@ release.*
|
||||
Gate shows Privacy 2.5 and Disclaimer 2.8 once. (e) The `ja` text of `Safety_AdminMode_*`, English until reviewed.
|
||||
(f) `docs/LIST_GAME_TESTED.md` — reviewed and approved by the owner before it was committed (D35, 2026-09-27);
|
||||
keep it current as games are run.
|
||||
8. **beta.11 on real hardware.** (a) GIRLS' FRONTLINE 2: the option on → *Eligible* → *Make exception…* (the disclosure
|
||||
`ac-exception-dialog/2`, with its *Trial* paragraph) → hooking on → two sessions: the card says *trial: 0 of 2*, then
|
||||
*1 of 2*, then *Exception in force since …* alone. (b) The library at your window's width, and the list; Refresh
|
||||
after installing a game, and with the USB drive unplugged (*Not installed*, the drive named). (c) Delete all sessions
|
||||
on a game's page and in Settings ▸ Data. (d) *Sessions at a glance* and the Trend with a second unit. (e) The Legal
|
||||
Gate shows the Disclaimer 2.9 and the EULA 1.4 once. (f) The `ja` text of `Safety_Exception_Trial` (English until
|
||||
reviewed) and the App strings marked `review`.
|
||||
|
||||
**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
|
||||
|
||||
+4
-4
@@ -11,8 +11,8 @@
|
||||
that changes what FrameLedger.Overlay or the capture host does; date the change.
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), 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
|
||||
@@ -84,8 +84,8 @@
|
||||
> game in the library, before injection, at a session's start or by the 30 s re-check; the game's page says so,
|
||||
> and nothing turns it back on for that executable — except a user-mode exception you make yourself, per game,
|
||||
> in Settings (off by default): only where the only finding is one anti-cheat that runs entirely in user mode, with
|
||||
> no driver file in the game's folder, on a game already measured successfully at least twice. The guard still
|
||||
> runs every check under it and ends it on anything new; a ban remains possible.
|
||||
> no driver file in the game's folder. Its first two sessions are a trial, and one that does not go well ends it
|
||||
> for good. The guard still runs every check under it and ends it on anything new; a ban remains possible.
|
||||
>
|
||||
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
|
||||
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
|
||||
|
||||
+13
-10
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — Disclaimer
|
||||
|
||||
**Version:** 2.8 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 2.9 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
> **How this document is kept true.** The statement of what FrameLedger measures (§4) is `legal/ACCURACY.md`,
|
||||
> embedded here and in `README.md` and bound to its source by `tools/accuracy-check.ps1`, which fails the build when a
|
||||
@@ -92,11 +92,14 @@ notes.
|
||||
**Since 0.1.0-beta.9 there is one exception, and it is not a way past the guard.** A Settings option, off unless you
|
||||
turn it on, lets you make an exception — one game at a time, after a disclosure you must accept — for a game whose only
|
||||
finding is a single anti-cheat that works entirely in user mode (no kernel driver, no service, and no driver file
|
||||
anywhere in the game's folder), that is on no list of titles FrameLedger refuses, and that FrameLedger has already
|
||||
measured successfully at least twice. Under it the guard still runs every check, before injecting and every 30
|
||||
seconds, and still refuses anything else it finds; the exception ends by itself when something new is found, when a
|
||||
session under it crashes or is stopped for safety, or when the game is updated, and turning the option off suspends
|
||||
it. Sessions recorded under it are marked with the anti-cheat they ran beside.
|
||||
anywhere in the game's folder) and that is on no list of titles FrameLedger refuses. Since 0.1.0-beta.11 the game does
|
||||
not need to have been measured before: **the first two sessions under the exception are a trial**, and if one of them
|
||||
does not go well — it crashes, records nothing, does not end normally, is stopped for safety, or something new is found
|
||||
— the exception ends and can never be made again for that game. Under it the guard still runs every check, before
|
||||
injecting and every 30 seconds, and still refuses anything else it finds; after the trial the exception ends by itself
|
||||
when something new is found, when a session under it crashes or is stopped for safety, or when the game is updated, and
|
||||
turning the option off suspends it. Sessions recorded under it are marked with the anti-cheat they ran beside. **Two
|
||||
good sessions are not evidence that the anti-cheat did not notice** — a ban may still come later.
|
||||
|
||||
**It exists because users asked for it, and it carries exactly the risk this document describes.** That anti-cheat
|
||||
may still detect FrameLedger in the game and warn, block or permanently ban your account — possibly days later — and
|
||||
@@ -114,8 +117,8 @@ Software running inside another process can, in principle, destabilize it. Frame
|
||||
Frame timing is derived from high-resolution timestamps taken at the moment the game presents each frame; upscaling, frame-generation and ray-tracing state are read from the parameters the game passes to those APIs. This is substantially more accurate than inferring settings from files on disk, but **no measurement is guaranteed to be exact**:
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-09-28.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.10`** (2026-09-28), an unsigned installer built from that tag with its
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-03.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.11`** (2026-10-03), 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
|
||||
@@ -187,8 +190,8 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
> game in the library, before injection, at a session's start or by the 30 s re-check; the game's page says so,
|
||||
> and nothing turns it back on for that executable — except a user-mode exception you make yourself, per game,
|
||||
> in Settings (off by default): only where the only finding is one anti-cheat that runs entirely in user mode, with
|
||||
> no driver file in the game's folder, on a game already measured successfully at least twice. The guard still
|
||||
> runs every check under it and ends it on anything new; a ban remains possible.
|
||||
> no driver file in the game's folder. Its first two sessions are a trial, and one that does not go well ends it
|
||||
> for good. The guard still runs every check under it and ends it on anything new; a ban remains possible.
|
||||
>
|
||||
> Where a value is not measured it reads `N/A`, with two exceptions: FPS then shows Presented FPS with a
|
||||
> note on what it may include, and ray-tracing flags may show a value you set yourself, labelled as
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# FrameLedger — End User License Agreement (EULA)
|
||||
|
||||
**Version:** 1.3 · **Effective:** {{RELEASE_DATE}}
|
||||
**Version:** 1.4 · **Effective:** {{RELEASE_DATE}}
|
||||
|
||||
This End User License Agreement ("Agreement") applies to **FrameLedger** ("the Software"), developed and published by **poli0981** ("the Developer"), contactable at <contact@poli0981.dev> — see <https://poli0981.dev/> for other contact channels.
|
||||
|
||||
@@ -14,7 +14,7 @@ The Software records game performance data, hardware telemetry (temperatures, lo
|
||||
|
||||
## 2A. Code injection — your responsibility
|
||||
|
||||
To measure rendering settings accurately, the Software can load a component into a game process, **but only for games you have individually enabled**, after a consent prompt that explains the risk. The Software refuses to do so when it detects anti-cheat or anti-tamper software, turns hooking off for that game, and provides no means to override that refusal — except a narrow, per-game exception for anti-cheat that works entirely in user mode, which you may make yourself, after a separate disclosure, for a game the Software has already measured successfully, and under which the Software still runs every check (Disclaimer §2A). By making such an exception you accept, for that game, the risk described in (b) below.
|
||||
To measure rendering settings accurately, the Software can load a component into a game process, **but only for games you have individually enabled**, after a consent prompt that explains the risk. The Software refuses to do so when it detects anti-cheat or anti-tamper software, turns hooking off for that game, and provides no means to override that refusal — except a narrow, per-game exception for anti-cheat that works entirely in user mode, which you may make yourself, after a separate disclosure, whose first two sessions are a trial that ends it for good if one of them does not go well, and under which the Software still runs every check (Disclaimer §2A). By making such an exception you accept, for that game, the risk described in (b) below.
|
||||
|
||||
By enabling this feature for a game, you confirm that:
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"level, which made it a check that could not fire."
|
||||
],
|
||||
"schemaVersion": 2,
|
||||
"rulesVersion": "2026.09.6",
|
||||
"rulesVersion": "2026.10.1",
|
||||
|
||||
"engines": [
|
||||
{
|
||||
@@ -419,7 +419,10 @@
|
||||
{ "store": "steam", "id": "1517290", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
|
||||
{ "store": "steam", "id": "2807960", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
|
||||
{ "store": "steam", "id": "2669320", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
|
||||
{ "store": "steam", "id": "3405690", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." }
|
||||
{ "store": "steam", "id": "3405690", "family": "EA AntiCheat", "reason": "Protected by EA AntiCheat (Javelin), a kernel anti-cheat." },
|
||||
{ "store": "steam", "id": "3224770", "family": "CrackProof", "reason": "Protected by CrackProof (HyperTech), a kernel anti-cheat; its driver is not in the game's folder." },
|
||||
{ "store": "steam", "id": "1973710", "family": "CrackProof", "reason": "Protected by CrackProof (HyperTech), a kernel anti-cheat; its driver is not in the game's folder." },
|
||||
{ "store": "steam", "id": "2987800", "family": "CrackProof", "reason": "Protected by CrackProof (HyperTech), a kernel anti-cheat; its driver is not in the game's folder." }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ internal static class AgentServices
|
||||
{
|
||||
services.AddSingleton<IUserModeExceptionSwitch, SettingsUserModeExceptionSwitch>();
|
||||
services.AddSingleton<IOverlayToleranceChannel>(static _ => new OverlayToleranceChannel(static line => Serilog.Log.Information("{Line}", line)));
|
||||
services.AddSingleton(static sp => new UserModeExceptionLapsePolicy(sp.GetRequiredService<IGameConsentStore>()));
|
||||
services.AddSingleton(static sp => new UserModeExceptionLapsePolicy(sp.GetRequiredService<IGameConsentStore>(), sp.GetRequiredService<ISessionRepository>()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -269,11 +269,12 @@ internal static class AgentServices
|
||||
sp.GetRequiredService<ExecutableRelocator>(),
|
||||
// beta.8: an executable that cannot run as x64 is refused before anything is scanned or stamped.
|
||||
new PeArchitectureSource(),
|
||||
// D33: the user-mode exception's option, evidence and disclosure version.
|
||||
// D33: the user-mode exception's option and disclosure version (D38: no session count any more).
|
||||
new AntiCheatExceptionCommands(
|
||||
sp.GetRequiredService<IUserModeExceptionSwitch>(),
|
||||
sp.GetRequiredService<ISessionRepository>(),
|
||||
AntiCheatExceptionDisclosure.Version));
|
||||
AntiCheatExceptionDisclosure.Version),
|
||||
// beta.11 (D40): Delete all sessions, of one game or of every game — the Agent's rows, deleted by the Agent.
|
||||
sp.GetRequiredService<ISessionRepository>());
|
||||
|
||||
/// <summary>
|
||||
/// <c>HelloAck.telemetrySource</c>: the layers this machine composes, read once on the first <c>Hello</c> by
|
||||
|
||||
@@ -280,6 +280,8 @@ public partial class App : System.Windows.Application
|
||||
// The admin mode's disclosure (beta.10, D34), shown before capture.run_elevated is turned on.
|
||||
builder.Services.AddSingleton<IAgentAdminPrompt, AgentAdminPrompt>();
|
||||
builder.Services.AddSingleton<AntiCheatExceptions>();
|
||||
// beta.11 (D40): Delete all sessions, of one game (its page) or of every game (Settings ▸ Data), through the Agent.
|
||||
builder.Services.AddSingleton<SessionDeletion>();
|
||||
|
||||
AddLibrary(builder.Services);
|
||||
|
||||
@@ -350,7 +352,9 @@ public partial class App : System.Windows.Application
|
||||
services.AddTransient<SystemInfoViewModel>();
|
||||
services.AddSingleton<Charts.SessionSeriesLoader>();
|
||||
services.AddSingleton<IFileSaver, FileSaver>();
|
||||
services.AddSingleton<ISessionSummaryOpener, SessionSummaryOpener>();
|
||||
services.AddSingleton<SessionSummaryOpener>();
|
||||
services.AddSingleton<ISessionSummaryOpener>(static sp => sp.GetRequiredService<SessionSummaryOpener>());
|
||||
services.AddSingleton<ISessionWindows>(static sp => sp.GetRequiredService<SessionSummaryOpener>()); // beta.11: Delete all sessions closes them
|
||||
services.AddSingleton<IMixedTierPrompt, MixedTierPrompt>();
|
||||
|
||||
// Settings, the safety notices and the Logs page (P3 PR-8a): the Run entry, the notices over the pipe's
|
||||
@@ -417,6 +421,8 @@ public partial class App : System.Windows.Application
|
||||
sp.GetRequiredService<IExecutableLocator>(),
|
||||
static line => Serilog.Log.Information("{Line}", line)));
|
||||
services.AddSingleton<IImportReview, ImportReviewPrompt>();
|
||||
// beta.11: the Games page on screen reloads when an import adds games (navigating to itself does nothing).
|
||||
services.AddSingleton<LibraryChanges>();
|
||||
services.AddSingleton<ImportLibraryFlow>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>A click on a trend landed on a session's points (beta.11, D39): which session.</summary>
|
||||
public sealed class SessionClickedEventArgs(long sessionId) : EventArgs
|
||||
{
|
||||
public long SessionId { get; } = sessionId;
|
||||
}
|
||||
@@ -1,18 +1,33 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using ScottPlot;
|
||||
using ScottPlot.Plottables;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>The trend line (one point per session, oldest first) with FR-6.3's hardware-change markers as labelled vertical lines.</summary>
|
||||
/// <summary>
|
||||
/// The trend: one point per session, oldest first, with FR-6.3's hardware-change markers as labelled vertical lines. Since
|
||||
/// beta.11 (owner decision D39) it draws several metrics at once — every line in the first unit against the left axis, a
|
||||
/// second unit against the right — and a click near a session's points raises <see cref="SessionClicked"/>, which the
|
||||
/// Sessions tab's overview uses to select that session.
|
||||
/// </summary>
|
||||
public partial class TrendChart : UserControl
|
||||
{
|
||||
/// <summary>How near a click must land to a session's points, in device-independent pixels.</summary>
|
||||
private const double _clickReach = 14;
|
||||
|
||||
private TrendPoint[] _all = [];
|
||||
|
||||
public TrendChart()
|
||||
{
|
||||
InitializeComponent();
|
||||
ChartTheme.Attach(Plot);
|
||||
Plot.MouseLeftButtonUp += OnPlotClicked;
|
||||
}
|
||||
|
||||
/// <summary>The session whose points a click landed on (<see cref="TrendPoint.SessionId"/>).</summary>
|
||||
public event EventHandler<SessionClickedEventArgs>? SessionClicked;
|
||||
|
||||
public ScottPlot.Plot ScottPlot => Plot.Plot;
|
||||
|
||||
public int DrawnPoints { get; private set; }
|
||||
@@ -20,9 +35,20 @@ public partial class TrendChart : UserControl
|
||||
/// <summary>How many of <see cref="DrawnPoints"/> were drawn hollow (a part of their session).</summary>
|
||||
public int HollowPoints { get; private set; }
|
||||
|
||||
public void Show(IReadOnlyList<TrendPoint> points, IReadOnlyList<HardwareChange> changes, string metricLabel)
|
||||
/// <summary>How many lines were drawn against the right axis (a second unit).</summary>
|
||||
public int RightAxisLines { get; private set; }
|
||||
|
||||
/// <summary>One metric — what the Trend drew before beta.11.</summary>
|
||||
public void Show(IReadOnlyList<TrendPoint> points, IReadOnlyList<HardwareChange> changes, string metricLabel) =>
|
||||
Show([new TrendLine(metricLabel, metricLabel, points)], changes);
|
||||
|
||||
/// <summary>
|
||||
/// Every line in <paramref name="lines"/>: the first line's unit on the left axis, the first other unit on the right,
|
||||
/// and a line in any further unit is not drawn (the selector allows two).
|
||||
/// </summary>
|
||||
public void Show(IReadOnlyList<TrendLine> lines, IReadOnlyList<HardwareChange> changes)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(points);
|
||||
ArgumentNullException.ThrowIfNull(lines);
|
||||
ArgumentNullException.ThrowIfNull(changes);
|
||||
ScottPlot.Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
@@ -31,31 +57,36 @@ public partial class TrendChart : UserControl
|
||||
plot.Axes.DateTimeTicksBottom();
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Trend_Axis_Date);
|
||||
plot.YLabel(metricLabel);
|
||||
DrawnPoints = points.Count;
|
||||
HollowPoints = points.Count(static t => t.SettingsChangedMidSession);
|
||||
if (points.Count > 0)
|
||||
{
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
double[] xs = [.. points.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] ys = [.. points.Select(static t => t.Value)];
|
||||
Scatter line = plot.Add.Scatter(xs, ys, p.Native);
|
||||
line.LineWidth = 2;
|
||||
line.MarkerSize = 7;
|
||||
line.LegendText = metricLabel;
|
||||
string? left = lines.Count > 0 ? lines[0].Unit : null;
|
||||
string? right = lines.Select(static l => l.Unit).FirstOrDefault(u => !string.Equals(u, left, StringComparison.Ordinal));
|
||||
plot.YLabel(left ?? string.Empty);
|
||||
plot.Axes.Right.Label.Text = right ?? string.Empty;
|
||||
|
||||
// A point that describes part of its session (settings changed, or a steady state) is drawn hollow over its
|
||||
// filled one: the line still passes through it, and it cannot be read as the session's own number.
|
||||
TrendPoint[] partial = [.. points.Where(static t => t.SettingsChangedMidSession)];
|
||||
if (partial.Length > 0)
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
Color[] palette = [p.Native, p.Displayed, p.Percentile, p.Sensor, p.SensorSecondary, p.Stutter, p.Histogram, p.Segment];
|
||||
var drawn = new List<TrendPoint>();
|
||||
int hollow = 0;
|
||||
int onRight = 0;
|
||||
for (int i = 0; i < lines.Count; i++)
|
||||
{
|
||||
TrendLine line = lines[i];
|
||||
bool isRight = right is not null && string.Equals(line.Unit, right, StringComparison.Ordinal);
|
||||
if (line.Points.Count == 0 || (!isRight && !string.Equals(line.Unit, left, StringComparison.Ordinal)))
|
||||
{
|
||||
double[] hx = [.. partial.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] hy = [.. partial.Select(static t => t.Value)];
|
||||
Scatter hollow = plot.Add.ScatterPoints(hx, hy, p.Data);
|
||||
hollow.MarkerSize = 6;
|
||||
hollow.MarkerShape = MarkerShape.FilledCircle;
|
||||
continue;
|
||||
}
|
||||
|
||||
hollow += AddLine(plot, line, palette[i % palette.Length], p.Data, isRight);
|
||||
onRight += isRight ? 1 : 0;
|
||||
drawn.AddRange(line.Points);
|
||||
}
|
||||
|
||||
_all = [.. drawn];
|
||||
DrawnPoints = drawn.Count;
|
||||
HollowPoints = hollow;
|
||||
RightAxisLines = onRight;
|
||||
if (drawn.Count > 0)
|
||||
{
|
||||
foreach (HardwareChange change in TrendSeriesBuilder.MergedByDay(changes))
|
||||
{
|
||||
VerticalLine marker = plot.Add.VerticalLine(change.At.LocalDateTime.ToOADate(), 1, p.StutterPso, LinePattern.Dashed);
|
||||
@@ -70,4 +101,67 @@ public partial class TrendChart : UserControl
|
||||
|
||||
Plot.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>One line, its hollow points, against the left or the right axis; how many were hollow.</summary>
|
||||
private static int AddLine(ScottPlot.Plot plot, TrendLine line, Color color, Color hollowColor, bool isRight)
|
||||
{
|
||||
double[] xs = [.. line.Points.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] ys = [.. line.Points.Select(static t => t.Value)];
|
||||
Scatter scatter = plot.Add.Scatter(xs, ys, color);
|
||||
scatter.LineWidth = 2;
|
||||
scatter.MarkerSize = 7;
|
||||
scatter.LegendText = isRight ? line.Label + " ▸" : line.Label;
|
||||
if (isRight)
|
||||
{
|
||||
scatter.Axes.YAxis = plot.Axes.Right;
|
||||
}
|
||||
|
||||
// A point that describes part of its session (settings changed, or a steady state) is drawn hollow over its filled
|
||||
// one: the line still passes through it, and it cannot be read as the session's own number.
|
||||
TrendPoint[] partial = [.. line.Points.Where(static t => t.SettingsChangedMidSession)];
|
||||
if (partial.Length > 0)
|
||||
{
|
||||
double[] hx = [.. partial.Select(static t => t.At.LocalDateTime.ToOADate())];
|
||||
double[] hy = [.. partial.Select(static t => t.Value)];
|
||||
Scatter dots = plot.Add.ScatterPoints(hx, hy, hollowColor);
|
||||
dots.MarkerSize = 6;
|
||||
dots.MarkerShape = MarkerShape.FilledCircle;
|
||||
if (isRight)
|
||||
{
|
||||
dots.Axes.YAxis = plot.Axes.Right;
|
||||
}
|
||||
}
|
||||
|
||||
return partial.Length;
|
||||
}
|
||||
|
||||
/// <summary>The session whose points are nearest the click along the date axis, if any is within <see cref="_clickReach"/>.</summary>
|
||||
private void OnPlotClicked(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (_all.Length == 0 || SessionClicked is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
System.Windows.Point at = e.GetPosition(Plot);
|
||||
float scale = Plot.DisplayScale;
|
||||
double clickX = at.X * scale;
|
||||
ScottPlot.Plot plot = Plot.Plot;
|
||||
TrendPoint? nearest = null;
|
||||
double best = double.MaxValue;
|
||||
foreach (TrendPoint point in _all)
|
||||
{
|
||||
double distance = Math.Abs(plot.GetPixel(new Coordinates(point.At.LocalDateTime.ToOADate(), 0)).X - clickX);
|
||||
if (distance < best)
|
||||
{
|
||||
best = distance;
|
||||
nearest = point;
|
||||
}
|
||||
}
|
||||
|
||||
if (nearest is { } hit && best <= _clickReach * scale)
|
||||
{
|
||||
SessionClicked.Invoke(this, new SessionClickedEventArgs(hit.SessionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// One metric's line on a trend (beta.11, owner decision D39: several metrics at once): its label, the unit that decides
|
||||
/// which axis it is drawn against, and its points (one per session, oldest first).
|
||||
/// </summary>
|
||||
/// <param name="Label">The metric, as the legend names it.</param>
|
||||
/// <param name="Unit">The axis label every line in the same unit shares.</param>
|
||||
/// <param name="Points">The sessions that have the metric.</param>
|
||||
public sealed record TrendLine(string Label, string Unit, IReadOnlyList<TrendPoint> Points);
|
||||
@@ -42,6 +42,44 @@ public static class TrendSeriesBuilder
|
||||
return points;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The axis a metric is drawn against (beta.11, D39): frame rates share one, temperatures, loads and shares, power,
|
||||
/// memory and the factor each have their own — two of them at most on one chart.
|
||||
/// </summary>
|
||||
public static string UnitOf(TrendMetric metric) => metric switch
|
||||
{
|
||||
TrendMetric.PresentedFps or TrendMetric.NativeFps or TrendMetric.Displayed or TrendMetric.P1Low or TrendMetric.P01Low => Strings.Trend_Unit_Fps,
|
||||
TrendMetric.MaxGpuTemp or TrendMetric.MaxCpuTemp => Strings.Trend_Unit_Celsius,
|
||||
TrendMetric.AvgGpuPower => Strings.Trend_Unit_Watts,
|
||||
TrendMetric.MaxVramProcess or TrendMetric.AvgRam => Strings.Trend_Unit_Megabytes,
|
||||
TrendMetric.FgFactor => Strings.Trend_Unit_Factor,
|
||||
_ => Strings.Trend_Unit_Percent,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The Sessions tab's overview (beta.11, D39): every hooked session's rate and lows on one chart — Presented FPS where
|
||||
/// no generated frame was counted, Native and Displayed where frame generation was measured (rule 6: never one inflated
|
||||
/// number), and the 1% and 0.1% lows — partial sessions included and drawn hollow.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<TrendLine> Overview(IReadOnlyList<SessionRow> rows)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(rows);
|
||||
(TrendMetric Metric, string Label)[] metrics =
|
||||
[
|
||||
(TrendMetric.PresentedFps, Strings.Trend_Metric_PresentedFps),
|
||||
(TrendMetric.NativeFps, Strings.Trend_Metric_NativeFps),
|
||||
(TrendMetric.Displayed, Strings.Trend_Metric_Displayed),
|
||||
(TrendMetric.P1Low, Strings.Trend_Metric_P1Low),
|
||||
(TrendMetric.P01Low, Strings.Trend_Metric_P01Low),
|
||||
];
|
||||
// Native and Displayed only where frames were generated: on a session that counted none, Native is the Presented rate
|
||||
// already drawn, and a second line on the same points reads as a second measurement.
|
||||
HashSet<long> generated = [.. rows.Where(static r => FpsPresentation.FromRow(r).Kind == FpsReadoutKind.Generated).Select(static r => r.Id)];
|
||||
return [.. metrics.Select(m => new TrendLine(m.Label, Strings.Trend_Unit_Fps,
|
||||
[.. Points(rows, m.Metric, includeMidSessionChanges: true).Where(p => m.Metric is not (TrendMetric.NativeFps or TrendMetric.Displayed) || generated.Contains(p.SessionId))]))
|
||||
.Where(static l => l.Points.Count > 0)];
|
||||
}
|
||||
|
||||
/// <summary>How many sessions FR-6.4 leaves out at the default setting.</summary>
|
||||
public static int ExcludedCount(IReadOnlyList<SessionRow> rows) => ExcludedCount(rows, TrendMetric.PresentedFps);
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// The library grid's panel (beta.11, owner request 2026-10-03: "the empty band on the right"): as many columns as
|
||||
/// <see cref="MinItemWidth"/> allows across the width it is given, every item stretched to an equal share of it, so a row
|
||||
/// is always full — a plain <see cref="WrapPanel"/> of 300 px cards left up to a card's width unused at the right. Each row
|
||||
/// is as tall as its tallest item. Not virtualizing: a library is hundreds of rows at most.
|
||||
/// </summary>
|
||||
public sealed class UniformWrapPanel : Panel
|
||||
{
|
||||
public static readonly DependencyProperty MinItemWidthProperty = DependencyProperty.Register(
|
||||
nameof(MinItemWidth), typeof(double), typeof(UniformWrapPanel), new FrameworkPropertyMetadata(300.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
|
||||
public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register(
|
||||
nameof(Spacing), typeof(double), typeof(UniformWrapPanel), new FrameworkPropertyMetadata(12.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
|
||||
/// <summary>The narrowest an item may be; the column count is the most that fit at this width or wider.</summary>
|
||||
public double MinItemWidth
|
||||
{
|
||||
get => (double)GetValue(MinItemWidthProperty);
|
||||
set => SetValue(MinItemWidthProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>The gap between columns and between rows.</summary>
|
||||
public double Spacing
|
||||
{
|
||||
get => (double)GetValue(SpacingProperty);
|
||||
set => SetValue(SpacingProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>How many columns of at least <paramref name="minItemWidth"/> fit in <paramref name="width"/>, never fewer than one.</summary>
|
||||
public static int ColumnsFor(double width, double minItemWidth, double spacing)
|
||||
{
|
||||
if (double.IsNaN(width) || double.IsInfinity(width) || minItemWidth <= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Math.Max(1, (int)Math.Floor((width + spacing) / (minItemWidth + spacing)));
|
||||
}
|
||||
|
||||
/// <summary>Each item's width when <paramref name="columns"/> share <paramref name="width"/> with gaps between them.</summary>
|
||||
public static double ItemWidthFor(double width, int columns, double spacing) =>
|
||||
columns <= 0 ? 0 : Math.Max(0, (width - ((columns - 1) * spacing)) / columns);
|
||||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
double width = double.IsInfinity(availableSize.Width) ? MinItemWidth : availableSize.Width;
|
||||
int columns = ColumnsFor(width, MinItemWidth, Spacing);
|
||||
double itemWidth = ItemWidthFor(width, columns, Spacing);
|
||||
double height = 0;
|
||||
double rowHeight = 0;
|
||||
int column = 0;
|
||||
int rows = 0;
|
||||
foreach (UIElement child in InternalChildren)
|
||||
{
|
||||
child.Measure(new Size(itemWidth, double.PositiveInfinity));
|
||||
rowHeight = Math.Max(rowHeight, child.DesiredSize.Height);
|
||||
if (++column == columns)
|
||||
{
|
||||
height += rowHeight;
|
||||
rows++;
|
||||
rowHeight = 0;
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (column > 0)
|
||||
{
|
||||
height += rowHeight;
|
||||
rows++;
|
||||
}
|
||||
|
||||
return new Size(width, height + (Math.Max(0, rows - 1) * Spacing));
|
||||
}
|
||||
|
||||
protected override Size ArrangeOverride(Size finalSize)
|
||||
{
|
||||
int columns = ColumnsFor(finalSize.Width, MinItemWidth, Spacing);
|
||||
double itemWidth = ItemWidthFor(finalSize.Width, columns, Spacing);
|
||||
UIElement[] children = [.. InternalChildren.Cast<UIElement>()];
|
||||
double y = 0;
|
||||
for (int start = 0; start < children.Length; start += columns)
|
||||
{
|
||||
int end = Math.Min(start + columns, children.Length);
|
||||
double rowHeight = 0;
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
rowHeight = Math.Max(rowHeight, children[i].DesiredSize.Height);
|
||||
}
|
||||
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
children[i].Arrange(new Rect((i - start) * (itemWidth + Spacing), y, itemWidth, rowHeight));
|
||||
}
|
||||
|
||||
y += rowHeight + Spacing;
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
<StackPanel>
|
||||
<ui:TextBlock Text="{Binding Intro}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,14,0,0" Text="{Binding Why}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,8,0,0" FontWeight="SemiBold" Text="{x:Static vm:AntiCheatExceptionDialogViewModel.Trial}" TextWrapping="Wrap" />
|
||||
|
||||
<Border Margin="0,14,0,0" Padding="12" CornerRadius="6" Background="{DynamicResource CardBackgroundFillColorDefaultBrush}">
|
||||
<ui:TextBlock FontWeight="SemiBold" Text="{Binding Risk}" TextWrapping="Wrap" />
|
||||
|
||||
@@ -10,14 +10,35 @@
|
||||
MinWidth="640">
|
||||
<!--
|
||||
FR-1.2's review checklist: nothing is added until the user says which; a row that is already in the library
|
||||
or has no executable cannot be ticked. Import never enables hooking (the intro says so).
|
||||
or has no executable cannot be ticked (its box is disabled since beta.11 - before, a tick was taken and ignored).
|
||||
Rows already in the library are hidden unless "Show the N games already in the library" is ticked, and then
|
||||
dimmed. Import never enables hooking (the intro says so).
|
||||
-->
|
||||
<StackPanel>
|
||||
<ui:TextBlock TextWrapping="Wrap" Text="{x:Static vm:ImportReviewViewModel.Intro}" />
|
||||
<CheckBox Margin="0,8,0,0" Content="{Binding ShowExistingText}" IsChecked="{Binding ShowExisting, Mode=TwoWay}"
|
||||
Visibility="{Binding HasExisting, Converter={StaticResource BoolToVis}}" />
|
||||
<DataGrid Margin="0,10,0,8" MaxHeight="360" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column"
|
||||
ItemsSource="{Binding Rows}" SelectionMode="Single" IsReadOnly="False">
|
||||
ItemsSource="{Binding Shown}" SelectionMode="Single" IsReadOnly="False">
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsExisting}" Value="True">
|
||||
<Setter Property="Opacity" Value="0.55" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" Width="40" />
|
||||
<DataGridTemplateColumn Width="40">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox HorizontalAlignment="Center" IsEnabled="{Binding CanImport}"
|
||||
AutomationProperties.Name="{Binding Name}"
|
||||
IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnPlatform}" Binding="{Binding PlatformText}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnName}" Binding="{Binding Name}" IsReadOnly="True" Width="2*" />
|
||||
<DataGridTextColumn Header="{x:Static vm:ImportReviewViewModel.ColumnExe}" Binding="{Binding ExeText}" IsReadOnly="True" Width="3*" />
|
||||
|
||||
@@ -215,6 +215,18 @@
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap"
|
||||
Text="{x:Static vm:GameDetailViewModel.SessionsEmptyText}"
|
||||
Visibility="{Binding ViewModel.SessionsEmpty, Converter={StaticResource BoolToVis}}" />
|
||||
<!-- beta.11 (D39): every hooked session's rate and lows at a glance; a click selects the session below. -->
|
||||
<StackPanel Visibility="{Binding ViewModel.OverviewVisible, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static vm:GameDetailViewModel.OverviewHeader}" />
|
||||
<ui:TextBlock Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.OverviewNote}" />
|
||||
<charts:TrendChart x:Name="Overview" Height="220" MinHeight="200" Margin="0,4,0,8" />
|
||||
</StackPanel>
|
||||
<!-- beta.11 (D40): the game, its settings and its consent stay; the confirmation says how many go. -->
|
||||
<StackPanel Margin="0,0,0,8" Orientation="Horizontal" HorizontalAlignment="Right"
|
||||
Visibility="{Binding ViewModel.SessionsEmpty, Converter={StaticResource InverseBoolToVis}}">
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.DeleteAllSessionsCommand}"
|
||||
Content="{x:Static vm:GameDetailViewModel.DeleteAllSessionsText}" Icon="{ui:SymbolIcon Delete24}" />
|
||||
</StackPanel>
|
||||
<DataGrid x:Name="SessionsGrid" AutoGenerateColumns="False" CanUserAddRows="False" IsReadOnly="True" HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ViewModel.Sessions}" SelectionMode="Extended" MouseDoubleClick="OnSessionDoubleClick"
|
||||
SelectedItem="{Binding ViewModel.SelectedSession, Mode=TwoWay}">
|
||||
@@ -323,6 +335,21 @@
|
||||
<CheckBox Margin="16,0,0,0" VerticalAlignment="Center" Content="{x:Static vm:GameDetailViewModel.IncludeMidSessionText}"
|
||||
IsChecked="{Binding ViewModel.IncludeMidSession}" />
|
||||
</StackPanel>
|
||||
<!-- beta.11 (D39): more metrics on the same chart; a second unit is drawn against the right axis, a third cannot be ticked. -->
|
||||
<ui:TextBlock Margin="0,10,0,0" Appearance="Secondary" Text="{x:Static vm:GameDetailViewModel.TrendExtrasLabel}" />
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.TrendExtras}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:TrendMetricOptionViewModel}">
|
||||
<CheckBox Margin="0,4,14,0" Content="{Binding Label}" IsChecked="{Binding IsSelected, Mode=TwoWay}" IsEnabled="{Binding IsEnabled}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ui:TextBlock Margin="0,4,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendExtrasNote}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" Text="{Binding ViewModel.TrendExcludedText}"
|
||||
Visibility="{Binding ViewModel.TrendExcludedText, Converter={StaticResource NullToCollapsed}}" />
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Tertiary" TextWrapping="Wrap" Text="{x:Static vm:GameDetailViewModel.TrendAverageNote}" />
|
||||
|
||||
@@ -14,6 +14,7 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
InitializeComponent();
|
||||
ViewModel.SelectionPresented += OnSelectionPresented;
|
||||
ViewModel.TrendPresented += OnTrendPresented;
|
||||
Overview.SessionClicked += OnOverviewClicked;
|
||||
// The view model starts loading before this page exists, and a load that finished first raised its events to
|
||||
// nobody: the Trend tab was blank on every first open (beta.8). Draw what it holds now; a later load redraws.
|
||||
OnTrendPresented(this, EventArgs.Empty);
|
||||
@@ -23,6 +24,7 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
{
|
||||
ViewModel.SelectionPresented -= OnSelectionPresented;
|
||||
ViewModel.TrendPresented -= OnTrendPresented;
|
||||
Overview.SessionClicked -= OnOverviewClicked;
|
||||
ViewModel.Detach();
|
||||
};
|
||||
}
|
||||
@@ -37,7 +39,22 @@ public partial class GameDetailPage : INavigableView<GameDetailViewModel>
|
||||
Latency.Show(ViewModel.SelectedSeries, ViewModel.SelectedSession?.Row.LatencyAvgUs, ViewModel.SelectedSession?.Row.LatencyP95Us);
|
||||
}
|
||||
|
||||
private void OnTrendPresented(object? sender, EventArgs e) => Trend.Show(ViewModel.TrendPoints, ViewModel.HardwareChanges, ViewModel.TrendMetricText);
|
||||
/// <summary>The Trend tab's lines (beta.11: several metrics at once) and the Sessions tab's overview, from one rebuild.</summary>
|
||||
private void OnTrendPresented(object? sender, EventArgs e)
|
||||
{
|
||||
Trend.Show(ViewModel.TrendLines, ViewModel.HardwareChanges);
|
||||
Overview.Show(ViewModel.OverviewLines, ViewModel.HardwareChanges);
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D39): a session picked on the overview is selected in the grid below it, and scrolled to.</summary>
|
||||
private void OnOverviewClicked(object? sender, Charts.SessionClickedEventArgs e)
|
||||
{
|
||||
ViewModel.SelectSession(e.SessionId);
|
||||
if (ViewModel.SelectedSession is { } session)
|
||||
{
|
||||
SessionsGrid.ScrollIntoView(session);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSessionDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
@@ -4,10 +4,16 @@
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:vm="clr-namespace:FrameLedger.App.ViewModels"
|
||||
xmlns:controls="clr-namespace:FrameLedger.App.Controls"
|
||||
Title="{x:Static res:Strings.Games_Header}"
|
||||
AllowDrop="True"
|
||||
Drop="OnDrop">
|
||||
<!-- 08_UI §Games: cards (ui:CardAction), search, sort; FR-1.1 add by pick or by dropping an .exe here. -->
|
||||
<!--
|
||||
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):
|
||||
the count in the title; a grid of cards that fills the width (UniformWrapPanel - a WrapPanel of 300 px cards left a
|
||||
card's width unused at the right) or a list (ui.library_view); Refresh reads the library again, offers the games the
|
||||
stores installed since, and marks the entries whose executable is gone.
|
||||
-->
|
||||
<ScrollViewer>
|
||||
<StackPanel Style="{StaticResource PageRoot}">
|
||||
<Grid>
|
||||
@@ -16,8 +22,10 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="0" FontTypography="Title" Text="{x:Static vm:GamesViewModel.Header}" />
|
||||
<ui:TextBlock Grid.Column="0" FontTypography="Title" Text="{Binding ViewModel.HeaderText}" />
|
||||
<ui:TextBox Grid.Column="1" MinWidth="220" Margin="0,0,12,0" VerticalAlignment="Center"
|
||||
AutomationProperties.Name="{x:Static vm:GamesViewModel.SearchPlaceholder}"
|
||||
Icon="{ui:SymbolIcon Search24}"
|
||||
@@ -29,7 +37,21 @@
|
||||
ItemsSource="{x:Static vm:GamesViewModel.Sorts}"
|
||||
SelectedValue="{Binding ViewModel.Sort, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
<ui:Button Grid.Column="3" Appearance="Primary" VerticalAlignment="Center"
|
||||
<!-- The view switch: the one button shown is the other view. -->
|
||||
<StackPanel Grid.Column="3" Margin="0,0,8,0" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.ShowListCommand}" Icon="{ui:SymbolIcon AppsList24}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.ListText}" AutomationProperties.Name="{x:Static vm:GamesViewModel.ListText}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource InverseBoolToVis}}" />
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.ShowGridCommand}" Icon="{ui:SymbolIcon Grid24}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.GridText}" AutomationProperties.Name="{x:Static vm:GamesViewModel.GridText}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource BoolToVis}}" />
|
||||
</StackPanel>
|
||||
<ui:Button Grid.Column="4" Margin="0,0,12,0" Appearance="Secondary" VerticalAlignment="Center"
|
||||
Command="{Binding ViewModel.RefreshCommand}"
|
||||
Content="{x:Static vm:GamesViewModel.RefreshText}"
|
||||
ToolTip="{x:Static vm:GamesViewModel.RefreshToolTip}"
|
||||
Icon="{ui:SymbolIcon ArrowClockwise24}" />
|
||||
<ui:Button Grid.Column="5" Appearance="Primary" VerticalAlignment="Center"
|
||||
Command="{Binding ViewModel.AddGameCommand}"
|
||||
Content="{x:Static vm:GamesViewModel.AddText}"
|
||||
Icon="{ui:SymbolIcon Add24}" />
|
||||
@@ -42,34 +64,42 @@
|
||||
Text="{x:Static vm:GamesViewModel.NoMatchText}"
|
||||
Visibility="{Binding ViewModel.NoMatch, Converter={StaticResource BoolToVis}}" />
|
||||
|
||||
<ItemsControl Margin="0,16,0,0" ItemsSource="{Binding ViewModel.Games}">
|
||||
<!-- The grid: as many columns as fit at 300 px or wider, each card an equal share of the width. -->
|
||||
<ItemsControl x:Name="CardGrid" Margin="0,16,0,0" ItemsSource="{Binding ViewModel.Games}"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource InverseBoolToVis}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
<controls:UniformWrapPanel MinItemWidth="300" Spacing="12" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:GameCardViewModel}">
|
||||
<ui:CardAction Width="300" Margin="0,0,12,12" IsChevronVisible="False"
|
||||
<ui:CardAction IsChevronVisible="False" VerticalAlignment="Stretch" VerticalContentAlignment="Top"
|
||||
Command="{Binding DataContext.ViewModel.OpenCommand, RelativeSource={RelativeSource AncestorType=Page}}"
|
||||
CommandParameter="{Binding}"
|
||||
Icon="{ui:SymbolIcon Games24}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" TextTrimming="CharacterEllipsis" />
|
||||
<StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,0"
|
||||
<!-- Pills wrap to a second line rather than being cut (the third one was, at 300 px). -->
|
||||
<WrapPanel Margin="0,4,0,0">
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
Visibility="{Binding HasPlatform, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{Binding PlatformText}" />
|
||||
</Border>
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,0"
|
||||
<Border Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
Visibility="{Binding HasEngine, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{Binding EngineText}" />
|
||||
</Border>
|
||||
<Border Style="{StaticResource HookStatePill}">
|
||||
<Border Style="{StaticResource HookStatePill}" Margin="0,0,6,4">
|
||||
<TextBlock Style="{StaticResource HookStatePillText}" Text="{Binding HookText}" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Secondary" Text="{Binding SessionsText}" />
|
||||
<Border x:Name="NotInstalledPill" Style="{StaticResource TagPill}" Margin="0,0,6,4"
|
||||
ToolTip="{Binding NotInstalledToolTip}"
|
||||
Visibility="{Binding NotInstalled, Converter={StaticResource BoolToVis}}">
|
||||
<TextBlock Style="{StaticResource TagPillText}" Text="{x:Static res:Strings.Games_Card_NotInstalled}" />
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
<ui:TextBlock Margin="0,2,0,0" Appearance="Secondary" Text="{Binding SessionsText}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding PlaytimeText}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding LastPlayedText}" />
|
||||
</StackPanel>
|
||||
@@ -77,6 +107,29 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<!-- The list: one row per game across the width; double-click or Enter opens it. -->
|
||||
<DataGrid x:Name="GameList" Margin="0,16,0,0" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
|
||||
CanUserSortColumns="False" HeadersVisibility="Column" IsReadOnly="True" SelectionMode="Single"
|
||||
ItemsSource="{Binding ViewModel.Games}"
|
||||
MouseDoubleClick="OnListDoubleClick" KeyDown="OnListKeyDown"
|
||||
Visibility="{Binding ViewModel.ListView, Converter={StaticResource BoolToVis}}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Name}" Binding="{Binding Name}" Width="3*" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Store}" Binding="{Binding PlatformText}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Engine}" Binding="{Binding EngineText}" Width="*" />
|
||||
<DataGridTemplateColumn Header="{x:Static res:Strings.Games_List_Status}" Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Margin="4,0" VerticalAlignment="Center" Text="{Binding StatusText}" ToolTip="{Binding NotInstalledToolTip}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Sessions}" Binding="{Binding SessionCount}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_Played}" Binding="{Binding PlaytimeValue}" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static res:Strings.Games_List_LastPlayed}" Binding="{Binding LastPlayedValue}" Width="Auto" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using Wpf.Ui.Abstractions.Controls;
|
||||
|
||||
@@ -11,6 +12,9 @@ public partial class GamesPage : INavigableView<GamesViewModel>
|
||||
ViewModel = viewModel ?? throw new ArgumentNullException(nameof(viewModel));
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
// beta.11: the page reloads itself while it is on screen (a session ends, an import adds games), and lets go after.
|
||||
Loaded += (_, _) => ViewModel.Attach();
|
||||
Unloaded += (_, _) => ViewModel.Detach();
|
||||
}
|
||||
|
||||
public GamesViewModel ViewModel { get; }
|
||||
@@ -23,4 +27,25 @@ public partial class GamesPage : INavigableView<GamesViewModel>
|
||||
_ = ViewModel.DropAsync(paths);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The list view opens a game on a double-click, as the cards do on a click.</summary>
|
||||
private void OnListDoubleClick(object sender, MouseButtonEventArgs e) => OpenSelected();
|
||||
|
||||
/// <summary>…and on Enter, so the list is usable from the keyboard.</summary>
|
||||
private void OnListKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
OpenSelected();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenSelected()
|
||||
{
|
||||
if (GameList.SelectedItem is GameCardViewModel card)
|
||||
{
|
||||
ViewModel.OpenCommand.Execute(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,10 @@
|
||||
<ui:TextBlock Appearance="Secondary" Text="{x:Static res:Strings.Settings_KillSwitch_Body}" TextWrapping="Wrap" />
|
||||
</ui:CardExpander>
|
||||
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True" Icon="{ui:SymbolIcon Games24}" Header="{x:Static res:Strings.Settings_HookedGames_Label}">
|
||||
<!-- beta.11 (owner request 2026-10-03: no row without a control): shown only while a game has hooking on, each with its Turn off. -->
|
||||
<ui:CardExpander Margin="0,8,0,0" IsExpanded="True" Icon="{ui:SymbolIcon Games24}" Header="{x:Static res:Strings.Settings_HookedGames_Label}"
|
||||
Visibility="{Binding ViewModel.HasHookedGames, Converter={StaticResource BoolToVis}}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Text="{x:Static res:Strings.Settings_HookedGames_Empty}"
|
||||
Visibility="{Binding ViewModel.HookedGames.Count, Converter={StaticResource ZeroToVisible}}" />
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.HookedGames}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -102,7 +101,6 @@
|
||||
<StackPanel Grid.Column="0">
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding Name}" />
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap" Text="{Binding FindingText}" />
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap" Text="{Binding SessionsText}" />
|
||||
<ui:TextBlock Appearance="Secondary" TextWrapping="Wrap" Text="{Binding StateText}" />
|
||||
<ui:TextBlock Appearance="Tertiary" TextWrapping="Wrap" Text="{Binding LapseText}"
|
||||
Visibility="{Binding LapseText, Converter={StaticResource NullToCollapsed}}" />
|
||||
@@ -121,10 +119,12 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<!-- Only while the Agent is still answering: the sweep publishes nothing, so this is how its answer arrives. -->
|
||||
<ui:Button Margin="0,8,0,0"
|
||||
Appearance="Secondary"
|
||||
Command="{Binding ViewModel.RefreshExceptionsCommand}"
|
||||
Content="{x:Static res:Strings.Settings_Exceptions_Refresh}" />
|
||||
Content="{x:Static res:Strings.Settings_Exceptions_Refresh}"
|
||||
Visibility="{Binding ViewModel.ExceptionsChecking, Converter={StaticResource BoolToVis}}" />
|
||||
</StackPanel>
|
||||
</ui:CardExpander>
|
||||
|
||||
@@ -213,23 +213,28 @@
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_Background_Label}" IsChecked="{Binding ViewModel.BackgroundCapture, Mode=TwoWay}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- Agent: elevation is optional and no tier needs it; the logon task arrives with the tray build. -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Agent_Header}" />
|
||||
<ui:CardExpander Margin="0,4,0,0" Icon="{ui:SymbolIcon Person24}">
|
||||
<ui:CardExpander.Header>
|
||||
<!-- beta.11 (owner request 2026-10-03: no row without a control): Data - Delete all sessions (D40). -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Data_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Delete24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_Agent_Elevation_Label}" />
|
||||
<ui:TextBlock Appearance="Secondary" Text="{Binding ViewModel.ElevationText}" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_DeleteSessions_Label}" />
|
||||
<ui:TextBlock MaxWidth="560" HorizontalAlignment="Left" Appearance="Secondary" Text="{x:Static res:Strings.Settings_DeleteSessions_Body}" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</ui:CardExpander.Header>
|
||||
<ui:TextBlock Appearance="Secondary" Text="{x:Static res:Strings.Settings_Agent_Elevation_Body}" TextWrapping="Wrap" />
|
||||
</ui:CardExpander>
|
||||
</ui:CardControl.Header>
|
||||
<ui:Button Appearance="Secondary" Command="{Binding ViewModel.DeleteAllSessionsCommand}" Content="{x:Static res:Strings.Settings_DeleteSessions_Button}" />
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- Agent: elevation is optional and no tier needs it. beta.11: the elevation line is the admin mode's own status, not a row of its own. -->
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Agent_Header}" />
|
||||
<!-- beta.10, the admin mode (D34): off by default; on shows the disclosure, and Windows asks at every Agent start. -->
|
||||
<ui:CardControl Margin="0,8,0,0" Icon="{ui:SymbolIcon Shield24}">
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Shield24}">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{x:Static res:Strings.Settings_Agent_RunElevated_Label}" />
|
||||
<ui:TextBlock MaxWidth="560" HorizontalAlignment="Left" Appearance="Secondary" Text="{x:Static res:Strings.Settings_Agent_RunElevated_Body}" TextWrapping="Wrap" />
|
||||
<ui:TextBlock Margin="0,4,0,0" FontTypography="BodyStrong" Text="{Binding ViewModel.ElevationText}" TextWrapping="Wrap"
|
||||
ToolTip="{x:Static res:Strings.Settings_Agent_Elevation_Body}" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch AutomationProperties.Name="{x:Static res:Strings.Settings_Agent_RunElevated_Label}" IsChecked="{Binding ViewModel.RunElevated, Mode=TwoWay}" />
|
||||
@@ -277,7 +282,6 @@
|
||||
SelectedValue="{Binding ViewModel.SelectedLanguage, Mode=TwoWay}"
|
||||
SelectedValuePath="Value" />
|
||||
</ui:CardControl>
|
||||
<ui:TextBlock Margin="0,6,0,0" Appearance="Secondary" Text="{x:Static vm:SettingsViewModel.LanguageNote}" TextWrapping="Wrap" />
|
||||
|
||||
<ui:TextBlock FontTypography="Subtitle" Margin="0,20,0,8" Text="{x:Static res:Strings.Settings_Window_Header}" />
|
||||
<ui:CardControl Margin="0,4,0,0" Icon="{ui:SymbolIcon Power24}">
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>D33: what the exception's disclosure names — the game, the anti-cheat family and its signal, and the evidence.</summary>
|
||||
public sealed record AntiCheatExceptionFacts(string GameName, string Family, string Signal, int Sessions);
|
||||
/// <summary>
|
||||
/// D33: what the exception's disclosure names — the game, the anti-cheat family and its signal. (D38 took the session count
|
||||
/// out: a grant needs no session, and its first two are a trial the disclosure describes.)
|
||||
/// </summary>
|
||||
public sealed record AntiCheatExceptionFacts(string GameName, string Family, string Signal);
|
||||
@@ -26,7 +26,7 @@ public sealed record AntiCheatExceptionResult(AntiCheatExceptionOutcome Outcome,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
/// <summary>Why no exception was made, in the user's language: the session count, the finding, or the block's kind.</summary>
|
||||
/// <summary>Why no exception was made, in the user's language: a failed trial (D38), the finding, or the block's kind.</summary>
|
||||
public string? RefusalText()
|
||||
{
|
||||
if (Refusal is null)
|
||||
@@ -36,11 +36,17 @@ public sealed record AntiCheatExceptionResult(AntiCheatExceptionOutcome Outcome,
|
||||
|
||||
return Refusal.Reason switch
|
||||
{
|
||||
"TooFewSessions" => string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_TooFew_Format, Refusal.Signal ?? "0"),
|
||||
"TrialFailed" => string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_TrialFailed_Format, TrialFailedDate(Refusal.Signal)),
|
||||
"BlockNotExceptionable" => Strings.Exception_State_NotAsked,
|
||||
"PreScanFailed" or "RulesUnreadable" or "RulesMalformed" or "RulesIncomplete" => Strings.Exception_State_CouldNotVerify,
|
||||
_ => string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_Refused_Format,
|
||||
Refusal.Family ?? Formats.GuardReasonText(Refusal.Reason), Refusal.Signal ?? Strings.Common_NotAvailable),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>D38: the Agent sends when the trial failed as unix milliseconds; anything else reads as not available.</summary>
|
||||
private static string TrialFailedDate(string? unixMs) =>
|
||||
long.TryParse(unixMs, NumberStyles.Integer, CultureInfo.InvariantCulture, out long ms)
|
||||
? Formats.Date(DateTimeOffset.FromUnixTimeMilliseconds(ms))
|
||||
: Strings.Common_NotAvailable;
|
||||
}
|
||||
@@ -27,4 +27,21 @@ public sealed class Confirmations : IConfirmations
|
||||
_ => RemoveGameChoice.Cancel,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D40): the one destructive button, in the danger colour; closing the box or Cancel deletes nothing.</summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public async Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
var box = new MessageBox
|
||||
{
|
||||
Title = gameName is null
|
||||
? Strings.DeleteSessions_AllTitle
|
||||
: string.Format(CultureInfo.CurrentCulture, Strings.DeleteSessions_GameTitle_Format, gameName),
|
||||
Content = string.Format(CultureInfo.CurrentCulture, gameName is null ? Strings.DeleteSessions_AllBody_Format : Strings.DeleteSessions_GameBody_Format, sessions),
|
||||
PrimaryButtonText = Strings.DeleteSessions_Delete,
|
||||
PrimaryButtonAppearance = ControlAppearance.Danger,
|
||||
CloseButtonText = Strings.Common_Cancel,
|
||||
};
|
||||
return await box.ShowDialogAsync(cancellationToken: ct).ConfigureAwait(true) == MessageBoxResult.Primary;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,10 @@ using FrameLedger.Domain.AntiCheat;
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): a blocked game's user-mode exception as the App shows it — in force, eligible, being
|
||||
/// checked, or why not — read from the Agent's columns (<see cref="GameRow.AcException"/>). The App decides nothing here:
|
||||
/// every state is a reading of what the Agent wrote, and the grant itself is the Agent's to make.
|
||||
/// D33 (owner decision 2026-09-26): a blocked game's user-mode exception as the App shows it — in force (and, since D38, how
|
||||
/// far its trial has come), eligible, being checked, or why not — read from the Agent's columns
|
||||
/// (<see cref="GameRow.AcException"/>). The App decides nothing here: every state is a reading of what the Agent wrote, and
|
||||
/// the grant itself is the Agent's to make.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string? Family, string? Signal, int Sessions, string? LapseText)
|
||||
@@ -21,7 +22,8 @@ public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string?
|
||||
|
||||
/// <summary>
|
||||
/// The row's exception, or null for a row it says nothing about (not blocked). Granted first — a grant stays until the
|
||||
/// Agent or the user ends it — then the block's kind, then the sweep's answer about THIS block.
|
||||
/// Agent or the user ends it — then the block's kind, then a failed trial (D38: for good, whatever a check says), then
|
||||
/// the sweep's answer about THIS block.
|
||||
/// </summary>
|
||||
public static ExceptionView? Of(GameRow row)
|
||||
{
|
||||
@@ -38,8 +40,7 @@ public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string?
|
||||
: null;
|
||||
if (x.IsGranted)
|
||||
{
|
||||
return new(ExceptionViewKind.Granted, string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_Granted_Format, Formats.Date(x.GrantedAt!.Value)),
|
||||
x.Family, block?.Signal, x.Sessions, lapse);
|
||||
return new(ExceptionViewKind.Granted, GrantedText(x), x.Family, block?.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
if (block is not { IsExceptionable: true } b)
|
||||
@@ -47,14 +48,27 @@ public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string?
|
||||
return new(ExceptionViewKind.NotEligible, Strings.Exception_State_NotAsked, block?.Family, block?.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
if (x.TrialFailedAt is { } failed)
|
||||
{
|
||||
return new(ExceptionViewKind.NotEligible, string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_TrialFailed_Format, Formats.Date(failed)),
|
||||
b.Family, b.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
if (!string.Equals(x.CheckedBlock, row.HookBlockedReason, StringComparison.Ordinal))
|
||||
{
|
||||
return new(ExceptionViewKind.Checking, Strings.Exception_State_Checking, b.Family, b.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
return x.Eligible
|
||||
? new(ExceptionViewKind.Eligible, Strings.Exception_State_Eligible, b.Family, b.Signal, x.Sessions, lapse)
|
||||
: new(NotEligibleKind(x), WhyNot(b, x), b.Family, b.Signal, x.Sessions, lapse);
|
||||
if (x.Eligible)
|
||||
{
|
||||
return new(ExceptionViewKind.Eligible, Strings.Exception_State_Eligible, b.Family, b.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
// A guard that let the family through over a row that does not say eligible is an answer from before D38 (it
|
||||
// counted sessions); the Agent's next pass rewrites it, so until then it is being checked.
|
||||
return StoredBlock.Parse(x.Verdict) is { Reason: AntiCheatRefusalReason.AllowedUnderUserModeException }
|
||||
? new(ExceptionViewKind.Checking, Strings.Exception_State_Checking, b.Family, b.Signal, x.Sessions, lapse)
|
||||
: new(ExceptionViewKind.NotEligible, WhyNot(b, x), b.Family, b.Signal, x.Sessions, lapse);
|
||||
}
|
||||
|
||||
/// <summary>Why the last grant ended, in words.</summary>
|
||||
@@ -67,14 +81,16 @@ public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string?
|
||||
UserModeExceptionLapse.SafetyUnhook => Strings.Exception_Lapse_SafetyUnhook,
|
||||
UserModeExceptionLapse.OverlayStopped => Strings.Exception_Lapse_OverlayStopped,
|
||||
UserModeExceptionLapse.SessionCrashed => Strings.Exception_Lapse_SessionCrashed,
|
||||
UserModeExceptionLapse.TrialFailed => Strings.Exception_Lapse_TrialFailed,
|
||||
_ => reason,
|
||||
};
|
||||
|
||||
/// <summary>The guard let the family through and only the evidence is short — the one "not yet" the Settings list shows.</summary>
|
||||
private static ExceptionViewKind NotEligibleKind(AntiCheatExceptionState x) =>
|
||||
StoredBlock.Parse(x.Verdict) is { Reason: AntiCheatRefusalReason.AllowedUnderUserModeException }
|
||||
? ExceptionViewKind.TooFewSessions
|
||||
: ExceptionViewKind.NotEligible;
|
||||
/// <summary>D38: a grant in its trial says how far it has come; one past it says only since when.</summary>
|
||||
private static string GrantedText(AntiCheatExceptionState x) =>
|
||||
UserModeExceptionRules.InTrial(x.Sessions)
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_GrantedTrial_Format, Formats.Date(x.GrantedAt!.Value), x.Sessions,
|
||||
UserModeExceptionRules.TrialSessions)
|
||||
: string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_Granted_Format, Formats.Date(x.GrantedAt!.Value));
|
||||
|
||||
private static string WhyNot(StoredBlock block, AntiCheatExceptionState x)
|
||||
{
|
||||
@@ -84,9 +100,11 @@ public sealed record ExceptionView(ExceptionViewKind Kind, string Text, string?
|
||||
return Strings.Exception_State_NotAsked;
|
||||
}
|
||||
|
||||
if (verdict.Value.Reason == AntiCheatRefusalReason.AllowedUnderUserModeException)
|
||||
// A plain pass: the tolerant scan found nothing of the family, so it confirmed nothing — the check DID finish
|
||||
// (it used to be said as "could not finish").
|
||||
if (verdict.Value.Reason == AntiCheatRefusalReason.Allow)
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_TooFew_Format, x.Sessions);
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.Exception_State_NotFound_Format, block.Family);
|
||||
}
|
||||
|
||||
if (!verdict.Value.IsExceptionable && verdict.Value.Family.Length == 0)
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>D33: the states a blocked game's user-mode exception is shown in (<see cref="ExceptionView"/>).</summary>
|
||||
/// <remarks>
|
||||
/// D38 (2026-10-03) removed <c>TooFewSessions</c>: a grant needs no session any more, so "not yet" is no longer a state —
|
||||
/// a game is eligible, being checked, or not eligible for a reason that says whether it can change.
|
||||
/// </remarks>
|
||||
public enum ExceptionViewKind
|
||||
{
|
||||
/// <summary>An exception is on the row.</summary>
|
||||
/// <summary>An exception is on the row (in its trial or past it).</summary>
|
||||
Granted,
|
||||
|
||||
/// <summary>The Agent found the game eligible; no exception has been made.</summary>
|
||||
Eligible,
|
||||
|
||||
/// <summary>The guard would let the family through, and the game has fewer than two successful hooked sessions.</summary>
|
||||
TooFewSessions,
|
||||
|
||||
/// <summary>The Agent has not answered about this block yet (the option was just turned on, or the block changed).</summary>
|
||||
Checking,
|
||||
|
||||
|
||||
@@ -4,4 +4,10 @@ namespace FrameLedger.App.Services;
|
||||
public interface IConfirmations
|
||||
{
|
||||
Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): delete every session of <paramref name="gameName"/>'s game — or of every game when it is null —
|
||||
/// <paramref name="sessions"/> of them; true only on the explicit delete button.
|
||||
/// </summary>
|
||||
Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The session summary windows that are open (beta.11, owner decision D40). After Delete all sessions a window left open
|
||||
/// would show a session that is gone, and a note written from it would go to whichever session reuses its id (the table has
|
||||
/// no AUTOINCREMENT).
|
||||
/// </summary>
|
||||
public interface ISessionWindows
|
||||
{
|
||||
/// <summary>Closes every open summary window whose session is no longer in the ledger.</summary>
|
||||
Task CloseDeletedAsync(CancellationToken ct = default);
|
||||
}
|
||||
@@ -8,7 +8,8 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>
|
||||
/// File ▸ Import library… (FR-1.2, P4 PR-4): discover every installed store's titles, show the review checklist,
|
||||
/// add what the user ticked — hooking off for every one, as File ▸ Add game… would — and land on the Games page.
|
||||
/// Nothing is launched, nothing is fetched, nothing is added without a tick.
|
||||
/// Nothing is launched, nothing is fetched, nothing is added without a tick. Since beta.11 the Games page's Refresh runs
|
||||
/// it for new games only: when every title found is already in the library it says so and shows no checklist.
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
public sealed class ImportLibraryFlow
|
||||
@@ -17,17 +18,22 @@ public sealed class ImportLibraryFlow
|
||||
private readonly IImportReview _review;
|
||||
private readonly IMessageStrip _strip;
|
||||
private readonly IPageNavigator _navigator;
|
||||
private readonly LibraryChanges? _changes;
|
||||
|
||||
public ImportLibraryFlow(LibraryImporter importer, IImportReview review, IMessageStrip strip, IPageNavigator navigator)
|
||||
public ImportLibraryFlow(LibraryImporter importer, IImportReview review, IMessageStrip strip, IPageNavigator navigator, LibraryChanges? changes = null)
|
||||
{
|
||||
_importer = importer ?? throw new ArgumentNullException(nameof(importer));
|
||||
_review = review ?? throw new ArgumentNullException(nameof(review));
|
||||
_strip = strip ?? throw new ArgumentNullException(nameof(strip));
|
||||
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
|
||||
_changes = changes;
|
||||
}
|
||||
|
||||
/// <summary>The report, or null when nothing was found or the user cancelled.</summary>
|
||||
public async Task<ImportReport?> RunAsync(CancellationToken ct = default)
|
||||
/// <summary>
|
||||
/// The report, or null when nothing was found or the user cancelled. <paramref name="onlyNew"/> (the Games page's
|
||||
/// Refresh): when no title found can be imported, say "no new games" and show nothing.
|
||||
/// </summary>
|
||||
public async Task<ImportReport?> RunAsync(bool onlyNew = false, CancellationToken ct = default)
|
||||
{
|
||||
IReadOnlyList<ImportCandidate> candidates = await _importer.DiscoverAsync(ct).ConfigureAwait(true);
|
||||
if (candidates.Count == 0)
|
||||
@@ -36,6 +42,12 @@ public sealed class ImportLibraryFlow
|
||||
return null;
|
||||
}
|
||||
|
||||
if (onlyNew && !candidates.Any(static c => c.CanImport))
|
||||
{
|
||||
_strip.Info(Strings.Import_Title, Strings.Import_NothingNew);
|
||||
return null;
|
||||
}
|
||||
|
||||
IReadOnlyList<ImportCandidate>? selected = await _review.ReviewAsync(candidates, ct).ConfigureAwait(true);
|
||||
if (selected is null || selected.Count == 0)
|
||||
{
|
||||
@@ -46,6 +58,8 @@ public sealed class ImportLibraryFlow
|
||||
_strip.Success(Strings.Import_Title, string.Format(CultureInfo.CurrentCulture, Strings.Import_Done_Format, report.Added, report.Skipped));
|
||||
if (report.Added > 0)
|
||||
{
|
||||
// The Games page, if it is the one on screen, does not reload on a navigation to itself: say so to it.
|
||||
_changes?.Announce();
|
||||
_navigator.Navigate<GamesPage>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The App's own "the library's rows changed" signal (beta.11, owner request 2026-10-03): an import adds entries, and a
|
||||
/// page already on screen reloads. Navigating to the page that is on screen does nothing in WPF UI 4.3.0, so the Games
|
||||
/// page never saw an import made from File ▸ Import library… while it was open. The Agent's own changes (a merge, a
|
||||
/// finding, a new session) reach the page through its session events and the Refresh button.
|
||||
/// </summary>
|
||||
public sealed class LibraryChanges
|
||||
{
|
||||
/// <summary>Raised on the thread that changed the library — the UI thread for every caller today.</summary>
|
||||
public event EventHandler? Changed;
|
||||
|
||||
/// <summary>Say that entries were added, removed or replaced.</summary>
|
||||
public void Announce() => Changed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Infrastructure.Ipc;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
using Serilog;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Delete all sessions (beta.11, owner decision D40), of one game from its page or of every game from Settings ▸ Data. The
|
||||
/// sessions are the Agent's rows (<c>06_DATA_MODEL</c> §Writer ownership), so the App asks it over the pipe, as Tools ▸
|
||||
/// Database maintenance asks for the retention sweep; the Agent refuses while a session it would delete under is being
|
||||
/// recorded. The confirmation is the caller's to ask first. After a delete it forgets what is gone, for both callers: File ▸
|
||||
/// Export's selection when it named a deleted session, and the summary windows open on one — session ids are reused once
|
||||
/// the newest is gone (no AUTOINCREMENT), so either would otherwise act on whichever session takes the id next.
|
||||
/// </summary>
|
||||
public sealed class SessionDeletion
|
||||
{
|
||||
private readonly IAgentRequests _agent;
|
||||
private readonly ISessionRepository? _sessions;
|
||||
private readonly SessionSelection? _selection;
|
||||
private readonly ISessionWindows? _windows;
|
||||
|
||||
public SessionDeletion(IAgentRequests agent, ISessionRepository? sessions = null, SessionSelection? selection = null, ISessionWindows? windows = null)
|
||||
{
|
||||
_agent = agent ?? throw new ArgumentNullException(nameof(agent));
|
||||
_sessions = sessions;
|
||||
_selection = selection;
|
||||
_windows = windows;
|
||||
}
|
||||
|
||||
/// <summary>Every session of <paramref name="gameId"/>, or of every game when it is null.</summary>
|
||||
public async Task<SessionDeletionResult> DeleteAsync(long? gameId, CancellationToken ct = default)
|
||||
{
|
||||
if (!_agent.IsConnected)
|
||||
{
|
||||
return new(SessionDeletionOutcome.AgentUnavailable);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IpcEnvelope envelope = await _agent.RequestAsync(IpcMessageType.DeleteSessions, new DeleteSessionsRequest(gameId), ct).ConfigureAwait(true);
|
||||
DeleteSessionsAck ack = IpcCodec.Payload<DeleteSessionsAck>(envelope) ?? throw new InvalidOperationException("DeleteSessions answered without a payload");
|
||||
Log.Information("sessions: deleted {Sessions} session(s) of {Games} game(s) ({Scope})", ack.Sessions, ack.Games, gameId is null ? "every game" : "game " + gameId);
|
||||
await ForgetDeletedAsync(ct).ConfigureAwait(true);
|
||||
return new(SessionDeletionOutcome.Deleted, ack.Games, ack.Sessions);
|
||||
}
|
||||
catch (IpcRequestException ex) when (string.Equals(ex.Code, IpcErrorCode.SessionRunning, StringComparison.Ordinal))
|
||||
{
|
||||
return new(SessionDeletionOutcome.SessionRunning);
|
||||
}
|
||||
catch (IpcRequestException ex) when (string.Equals(ex.Code, IpcErrorCode.UnknownType, StringComparison.Ordinal))
|
||||
{
|
||||
Log.Warning("sessions: the Agent does not know DeleteSessions ({Message})", ex.Message);
|
||||
return new(SessionDeletionOutcome.AgentTooOld);
|
||||
}
|
||||
catch (Exception ex) when (ex is IpcRequestException or InvalidOperationException or TimeoutException)
|
||||
{
|
||||
Log.Warning("sessions: DeleteSessions failed ({Message})", ex.Message);
|
||||
return new(SessionDeletionOutcome.Failed, Detail: ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The delete happened: what still names a deleted session lets go of it. A failure here is logged, not the delete's.</summary>
|
||||
private async Task ForgetDeletedAsync(CancellationToken ct)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_sessions is not null && _selection?.SessionId is long selected && await _sessions.FindByIdAsync(selected, ct).ConfigureAwait(true) is null)
|
||||
{
|
||||
_selection.Set(null);
|
||||
}
|
||||
|
||||
if (_windows is not null)
|
||||
{
|
||||
await _windows.CloseDeletedAsync(ct).ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is not OutOfMemoryException and not OperationCanceledException)
|
||||
{
|
||||
Log.Warning(ex, "sessions: the deleted sessions' selection and windows were not all let go of");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>How a <c>DeleteSessions</c> ask ended (beta.11, D40).</summary>
|
||||
public enum SessionDeletionOutcome
|
||||
{
|
||||
/// <summary>The Agent deleted them; the counts say how many.</summary>
|
||||
Deleted,
|
||||
|
||||
/// <summary>A session it would delete under is being recorded: nothing was deleted.</summary>
|
||||
SessionRunning,
|
||||
|
||||
/// <summary>The capture agent is not connected: nothing was asked.</summary>
|
||||
AgentUnavailable,
|
||||
|
||||
/// <summary>The Agent does not know the request (an older build): nothing was deleted.</summary>
|
||||
AgentTooOld,
|
||||
|
||||
/// <summary>Anything else; the detail says what.</summary>
|
||||
Failed,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>What a <c>DeleteSessions</c> ask did (beta.11, D40), and the sentence to tell the user.</summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed record SessionDeletionResult(SessionDeletionOutcome Outcome, int Games = 0, int Sessions = 0, string? Detail = null)
|
||||
{
|
||||
public bool Succeeded => Outcome == SessionDeletionOutcome.Deleted;
|
||||
|
||||
public string Message => Outcome switch
|
||||
{
|
||||
SessionDeletionOutcome.Deleted => string.Format(CultureInfo.CurrentCulture, Strings.DeleteSessions_Done_Format, Sessions, Games),
|
||||
SessionDeletionOutcome.SessionRunning => Strings.DeleteSessions_Running,
|
||||
SessionDeletionOutcome.AgentUnavailable => Strings.DeleteSessions_NoAgent,
|
||||
SessionDeletionOutcome.AgentTooOld => Strings.DeleteSessions_AgentTooOld,
|
||||
_ => Detail ?? Strings.Common_NotAvailable,
|
||||
};
|
||||
}
|
||||
@@ -10,15 +10,18 @@ namespace FrameLedger.App.Services;
|
||||
/// <summary>
|
||||
/// Builds a summary window per open: the view model's override prompt is bound to THAT window's dialog host,
|
||||
/// which is why the window is composed here rather than resolved whole from DI. The load runs after
|
||||
/// <c>Show()</c> so the window appears at once and fills in.
|
||||
/// <c>Show()</c> so the window appears at once and fills in. It keeps the windows it opened, so that Delete all sessions
|
||||
/// can close the ones whose session is gone (<see cref="ISessionWindows"/>, beta.11).
|
||||
/// </summary>
|
||||
public sealed class SessionSummaryOpener : ISessionSummaryOpener
|
||||
public sealed class SessionSummaryOpener : ISessionSummaryOpener, ISessionWindows
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly ShellHost _shell;
|
||||
|
||||
private readonly SessionSelection _selection;
|
||||
|
||||
private readonly List<(long SessionId, SessionSummaryWindow Window)> _open = [];
|
||||
|
||||
public SessionSummaryOpener(IServiceProvider services, ShellHost shell, SessionSelection selection)
|
||||
{
|
||||
_services = services ?? throw new ArgumentNullException(nameof(services));
|
||||
@@ -43,10 +46,26 @@ public sealed class SessionSummaryOpener : ISessionSummaryOpener
|
||||
{
|
||||
Owner = _shell.Current,
|
||||
};
|
||||
(long, SessionSummaryWindow) open = (sessionId, window);
|
||||
_open.Add(open);
|
||||
window.Closed += (_, _) => _open.Remove(open);
|
||||
window.Show();
|
||||
_ = LoadAsync(viewModel, sessionId);
|
||||
}
|
||||
|
||||
public async Task CloseDeletedAsync(CancellationToken ct = default)
|
||||
{
|
||||
ISessionRepository sessions = _services.GetRequiredService<ISessionRepository>();
|
||||
foreach ((long SessionId, SessionSummaryWindow Window) open in _open.ToArray())
|
||||
{
|
||||
// Still open after the read: the user may have closed it meanwhile, and a closed window is not closed twice.
|
||||
if (await sessions.FindByIdAsync(open.SessionId, ct).ConfigureAwait(true) is null && _open.Contains(open))
|
||||
{
|
||||
open.Window.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task LoadAsync(SessionSummaryViewModel viewModel, long sessionId)
|
||||
{
|
||||
try
|
||||
|
||||
Generated
+131
-11
@@ -183,6 +183,15 @@ public static class Strings
|
||||
nameof(Dashboard_Totals_Games),
|
||||
nameof(Dashboard_Totals_Playtime),
|
||||
nameof(Dashboard_Totals_ThisWeek),
|
||||
nameof(DeleteSessions_AgentTooOld),
|
||||
nameof(DeleteSessions_AllBody_Format),
|
||||
nameof(DeleteSessions_AllTitle),
|
||||
nameof(DeleteSessions_Delete),
|
||||
nameof(DeleteSessions_Done_Format),
|
||||
nameof(DeleteSessions_GameBody_Format),
|
||||
nameof(DeleteSessions_GameTitle_Format),
|
||||
nameof(DeleteSessions_NoAgent),
|
||||
nameof(DeleteSessions_Running),
|
||||
nameof(Diag_Written_Format),
|
||||
nameof(Display_Buffer_Format),
|
||||
nameof(Display_BufferEffect_Format),
|
||||
@@ -244,20 +253,22 @@ public static class Strings
|
||||
nameof(Exception_Lapse_OverlayStopped),
|
||||
nameof(Exception_Lapse_SafetyUnhook),
|
||||
nameof(Exception_Lapse_SessionCrashed),
|
||||
nameof(Exception_Lapse_TrialFailed),
|
||||
nameof(Exception_Lapse_Withdrawn),
|
||||
nameof(Exception_Lapsed_Format),
|
||||
nameof(Exception_Result_Granted_Format),
|
||||
nameof(Exception_Result_Refused_Format),
|
||||
nameof(Exception_Result_Withdrawn_Format),
|
||||
nameof(Exception_Sessions_Format),
|
||||
nameof(Exception_State_Checking),
|
||||
nameof(Exception_State_CouldNotVerify),
|
||||
nameof(Exception_State_Eligible),
|
||||
nameof(Exception_State_Granted_Format),
|
||||
nameof(Exception_State_GrantedTrial_Format),
|
||||
nameof(Exception_State_NotAsked),
|
||||
nameof(Exception_State_NotFound_Format),
|
||||
nameof(Exception_State_NotUserMode_Format),
|
||||
nameof(Exception_State_Refused_Format),
|
||||
nameof(Exception_State_TooFew_Format),
|
||||
nameof(Exception_State_TrialFailed_Format),
|
||||
nameof(Exe_DriveMissing_Format),
|
||||
nameof(Exe_FileMissing_Format),
|
||||
nameof(Exit_Code_Format),
|
||||
@@ -358,10 +369,12 @@ public static class Strings
|
||||
nameof(Fps_Native_Tooltip),
|
||||
nameof(Fps_None_Tooltip),
|
||||
nameof(Fps_Presented_Format),
|
||||
nameof(GameDetail_AntiCheat_Exceptionable_Format),
|
||||
nameof(GameDetail_AntiCheat_Format),
|
||||
nameof(GameDetail_AntiCheat_Header),
|
||||
nameof(GameDetail_Back),
|
||||
nameof(GameDetail_ChangeExe),
|
||||
nameof(GameDetail_DeleteSessions),
|
||||
nameof(GameDetail_Details_Architecture),
|
||||
nameof(GameDetail_Details_Engine),
|
||||
nameof(GameDetail_Details_EngineVersion),
|
||||
@@ -400,6 +413,8 @@ public static class Strings
|
||||
nameof(GameDetail_Measured_Header),
|
||||
nameof(GameDetail_Measured_NotHooked),
|
||||
nameof(GameDetail_NotFound),
|
||||
nameof(GameDetail_Overview_Header),
|
||||
nameof(GameDetail_Overview_Note),
|
||||
nameof(GameDetail_Recording_Body),
|
||||
nameof(GameDetail_Recording_Header),
|
||||
nameof(GameDetail_Recording_Off),
|
||||
@@ -423,17 +438,30 @@ public static class Strings
|
||||
nameof(Games_Card_HookOn),
|
||||
nameof(Games_Card_LastPlayed_Format),
|
||||
nameof(Games_Card_NeverPlayed),
|
||||
nameof(Games_Card_NotInstalled),
|
||||
nameof(Games_Card_NotRecorded),
|
||||
nameof(Games_Card_Playtime_Format),
|
||||
nameof(Games_Card_Sessions_Format),
|
||||
nameof(Games_Empty),
|
||||
nameof(Games_Header),
|
||||
nameof(Games_Header_Count_Format),
|
||||
nameof(Games_List_Engine),
|
||||
nameof(Games_List_LastPlayed),
|
||||
nameof(Games_List_Name),
|
||||
nameof(Games_List_Played),
|
||||
nameof(Games_List_Sessions),
|
||||
nameof(Games_List_Status),
|
||||
nameof(Games_List_Store),
|
||||
nameof(Games_NoMatch),
|
||||
nameof(Games_Refresh),
|
||||
nameof(Games_Refresh_ToolTip),
|
||||
nameof(Games_Search_Placeholder),
|
||||
nameof(Games_Sort_Label),
|
||||
nameof(Games_Sort_LastPlayed),
|
||||
nameof(Games_Sort_Name),
|
||||
nameof(Games_Sort_Playtime),
|
||||
nameof(Games_View_Grid),
|
||||
nameof(Games_View_List),
|
||||
nameof(Guard_ConsentMissing),
|
||||
nameof(Guard_DriverScanFailed),
|
||||
nameof(Guard_HookNotEnabled),
|
||||
@@ -468,9 +496,11 @@ public static class Strings
|
||||
nameof(Import_Note_Moved),
|
||||
nameof(Import_Note_NoExe),
|
||||
nameof(Import_NothingFound),
|
||||
nameof(Import_NothingNew),
|
||||
nameof(Import_SelectAll),
|
||||
nameof(Import_Selected_Format),
|
||||
nameof(Import_SelectNone),
|
||||
nameof(Import_ShowExisting_Format),
|
||||
nameof(Import_Title),
|
||||
nameof(Latency_Avg),
|
||||
nameof(Latency_Axis),
|
||||
@@ -670,6 +700,10 @@ public static class Strings
|
||||
nameof(Settings_Capture_Header),
|
||||
nameof(Settings_Channel_Beta),
|
||||
nameof(Settings_Channel_Stable),
|
||||
nameof(Settings_Data_Header),
|
||||
nameof(Settings_DeleteSessions_Body),
|
||||
nameof(Settings_DeleteSessions_Button),
|
||||
nameof(Settings_DeleteSessions_Label),
|
||||
nameof(Settings_Exceptions_Body),
|
||||
nameof(Settings_Exceptions_Checking),
|
||||
nameof(Settings_Exceptions_Empty),
|
||||
@@ -684,7 +718,6 @@ public static class Strings
|
||||
nameof(Settings_Header),
|
||||
nameof(Settings_HideAntiCheatHooking_Body),
|
||||
nameof(Settings_HideAntiCheatHooking_Label),
|
||||
nameof(Settings_HookedGames_Empty),
|
||||
nameof(Settings_HookedGames_Label),
|
||||
nameof(Settings_HookedGames_Revoke),
|
||||
nameof(Settings_Interval_Body),
|
||||
@@ -695,7 +728,6 @@ public static class Strings
|
||||
nameof(Settings_KillSwitch_Off),
|
||||
nameof(Settings_KillSwitch_On),
|
||||
nameof(Settings_Language_Label),
|
||||
nameof(Settings_Language_Note),
|
||||
nameof(Settings_Legal_Header),
|
||||
nameof(Settings_Legal_Reopen),
|
||||
nameof(Settings_LogDebug_Body),
|
||||
@@ -829,6 +861,8 @@ public static class Strings
|
||||
nameof(Trend_Empty),
|
||||
nameof(Trend_Empty_Format),
|
||||
nameof(Trend_Excluded_Format),
|
||||
nameof(Trend_Extras_Label),
|
||||
nameof(Trend_Extras_Note),
|
||||
nameof(Trend_IncludeMidSession),
|
||||
nameof(Trend_Metric_Average),
|
||||
nameof(Trend_Metric_AvgCpuLoad),
|
||||
@@ -849,6 +883,12 @@ public static class Strings
|
||||
nameof(Trend_Metric_P1Low),
|
||||
nameof(Trend_Metric_PresentedFps),
|
||||
nameof(Trend_Partial_Note),
|
||||
nameof(Trend_Unit_Celsius),
|
||||
nameof(Trend_Unit_Factor),
|
||||
nameof(Trend_Unit_Fps),
|
||||
nameof(Trend_Unit_Megabytes),
|
||||
nameof(Trend_Unit_Percent),
|
||||
nameof(Trend_Unit_Watts),
|
||||
nameof(Uninstall_DataFolder_Body),
|
||||
nameof(Uninstall_DataFolder_Title),
|
||||
nameof(Update_AgentStillRunning),
|
||||
@@ -1196,6 +1236,24 @@ public static class Strings
|
||||
|
||||
public static string Dashboard_Totals_ThisWeek => ResourceManager.GetString(nameof(Dashboard_Totals_ThisWeek), Culture) ?? nameof(Dashboard_Totals_ThisWeek);
|
||||
|
||||
public static string DeleteSessions_AgentTooOld => ResourceManager.GetString(nameof(DeleteSessions_AgentTooOld), Culture) ?? nameof(DeleteSessions_AgentTooOld);
|
||||
|
||||
public static string DeleteSessions_AllBody_Format => ResourceManager.GetString(nameof(DeleteSessions_AllBody_Format), Culture) ?? nameof(DeleteSessions_AllBody_Format);
|
||||
|
||||
public static string DeleteSessions_AllTitle => ResourceManager.GetString(nameof(DeleteSessions_AllTitle), Culture) ?? nameof(DeleteSessions_AllTitle);
|
||||
|
||||
public static string DeleteSessions_Delete => ResourceManager.GetString(nameof(DeleteSessions_Delete), Culture) ?? nameof(DeleteSessions_Delete);
|
||||
|
||||
public static string DeleteSessions_Done_Format => ResourceManager.GetString(nameof(DeleteSessions_Done_Format), Culture) ?? nameof(DeleteSessions_Done_Format);
|
||||
|
||||
public static string DeleteSessions_GameBody_Format => ResourceManager.GetString(nameof(DeleteSessions_GameBody_Format), Culture) ?? nameof(DeleteSessions_GameBody_Format);
|
||||
|
||||
public static string DeleteSessions_GameTitle_Format => ResourceManager.GetString(nameof(DeleteSessions_GameTitle_Format), Culture) ?? nameof(DeleteSessions_GameTitle_Format);
|
||||
|
||||
public static string DeleteSessions_NoAgent => ResourceManager.GetString(nameof(DeleteSessions_NoAgent), Culture) ?? nameof(DeleteSessions_NoAgent);
|
||||
|
||||
public static string DeleteSessions_Running => ResourceManager.GetString(nameof(DeleteSessions_Running), Culture) ?? nameof(DeleteSessions_Running);
|
||||
|
||||
public static string Diag_Written_Format => ResourceManager.GetString(nameof(Diag_Written_Format), Culture) ?? nameof(Diag_Written_Format);
|
||||
|
||||
public static string Display_Buffer_Format => ResourceManager.GetString(nameof(Display_Buffer_Format), Culture) ?? nameof(Display_Buffer_Format);
|
||||
@@ -1318,6 +1376,8 @@ public static class Strings
|
||||
|
||||
public static string Exception_Lapse_SessionCrashed => ResourceManager.GetString(nameof(Exception_Lapse_SessionCrashed), Culture) ?? nameof(Exception_Lapse_SessionCrashed);
|
||||
|
||||
public static string Exception_Lapse_TrialFailed => ResourceManager.GetString(nameof(Exception_Lapse_TrialFailed), Culture) ?? nameof(Exception_Lapse_TrialFailed);
|
||||
|
||||
public static string Exception_Lapse_Withdrawn => ResourceManager.GetString(nameof(Exception_Lapse_Withdrawn), Culture) ?? nameof(Exception_Lapse_Withdrawn);
|
||||
|
||||
public static string Exception_Lapsed_Format => ResourceManager.GetString(nameof(Exception_Lapsed_Format), Culture) ?? nameof(Exception_Lapsed_Format);
|
||||
@@ -1328,8 +1388,6 @@ public static class Strings
|
||||
|
||||
public static string Exception_Result_Withdrawn_Format => ResourceManager.GetString(nameof(Exception_Result_Withdrawn_Format), Culture) ?? nameof(Exception_Result_Withdrawn_Format);
|
||||
|
||||
public static string Exception_Sessions_Format => ResourceManager.GetString(nameof(Exception_Sessions_Format), Culture) ?? nameof(Exception_Sessions_Format);
|
||||
|
||||
public static string Exception_State_Checking => ResourceManager.GetString(nameof(Exception_State_Checking), Culture) ?? nameof(Exception_State_Checking);
|
||||
|
||||
public static string Exception_State_CouldNotVerify => ResourceManager.GetString(nameof(Exception_State_CouldNotVerify), Culture) ?? nameof(Exception_State_CouldNotVerify);
|
||||
@@ -1338,13 +1396,17 @@ public static class Strings
|
||||
|
||||
public static string Exception_State_Granted_Format => ResourceManager.GetString(nameof(Exception_State_Granted_Format), Culture) ?? nameof(Exception_State_Granted_Format);
|
||||
|
||||
public static string Exception_State_GrantedTrial_Format => ResourceManager.GetString(nameof(Exception_State_GrantedTrial_Format), Culture) ?? nameof(Exception_State_GrantedTrial_Format);
|
||||
|
||||
public static string Exception_State_NotAsked => ResourceManager.GetString(nameof(Exception_State_NotAsked), Culture) ?? nameof(Exception_State_NotAsked);
|
||||
|
||||
public static string Exception_State_NotFound_Format => ResourceManager.GetString(nameof(Exception_State_NotFound_Format), Culture) ?? nameof(Exception_State_NotFound_Format);
|
||||
|
||||
public static string Exception_State_NotUserMode_Format => ResourceManager.GetString(nameof(Exception_State_NotUserMode_Format), Culture) ?? nameof(Exception_State_NotUserMode_Format);
|
||||
|
||||
public static string Exception_State_Refused_Format => ResourceManager.GetString(nameof(Exception_State_Refused_Format), Culture) ?? nameof(Exception_State_Refused_Format);
|
||||
|
||||
public static string Exception_State_TooFew_Format => ResourceManager.GetString(nameof(Exception_State_TooFew_Format), Culture) ?? nameof(Exception_State_TooFew_Format);
|
||||
public static string Exception_State_TrialFailed_Format => ResourceManager.GetString(nameof(Exception_State_TrialFailed_Format), Culture) ?? nameof(Exception_State_TrialFailed_Format);
|
||||
|
||||
public static string Exe_DriveMissing_Format => ResourceManager.GetString(nameof(Exe_DriveMissing_Format), Culture) ?? nameof(Exe_DriveMissing_Format);
|
||||
|
||||
@@ -1546,6 +1608,8 @@ public static class Strings
|
||||
|
||||
public static string Fps_Presented_Format => ResourceManager.GetString(nameof(Fps_Presented_Format), Culture) ?? nameof(Fps_Presented_Format);
|
||||
|
||||
public static string GameDetail_AntiCheat_Exceptionable_Format => ResourceManager.GetString(nameof(GameDetail_AntiCheat_Exceptionable_Format), Culture) ?? nameof(GameDetail_AntiCheat_Exceptionable_Format);
|
||||
|
||||
public static string GameDetail_AntiCheat_Format => ResourceManager.GetString(nameof(GameDetail_AntiCheat_Format), Culture) ?? nameof(GameDetail_AntiCheat_Format);
|
||||
|
||||
public static string GameDetail_AntiCheat_Header => ResourceManager.GetString(nameof(GameDetail_AntiCheat_Header), Culture) ?? nameof(GameDetail_AntiCheat_Header);
|
||||
@@ -1554,6 +1618,8 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_ChangeExe => ResourceManager.GetString(nameof(GameDetail_ChangeExe), Culture) ?? nameof(GameDetail_ChangeExe);
|
||||
|
||||
public static string GameDetail_DeleteSessions => ResourceManager.GetString(nameof(GameDetail_DeleteSessions), Culture) ?? nameof(GameDetail_DeleteSessions);
|
||||
|
||||
public static string GameDetail_Details_Architecture => ResourceManager.GetString(nameof(GameDetail_Details_Architecture), Culture) ?? nameof(GameDetail_Details_Architecture);
|
||||
|
||||
public static string GameDetail_Details_Engine => ResourceManager.GetString(nameof(GameDetail_Details_Engine), Culture) ?? nameof(GameDetail_Details_Engine);
|
||||
@@ -1630,6 +1696,10 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_NotFound => ResourceManager.GetString(nameof(GameDetail_NotFound), Culture) ?? nameof(GameDetail_NotFound);
|
||||
|
||||
public static string GameDetail_Overview_Header => ResourceManager.GetString(nameof(GameDetail_Overview_Header), Culture) ?? nameof(GameDetail_Overview_Header);
|
||||
|
||||
public static string GameDetail_Overview_Note => ResourceManager.GetString(nameof(GameDetail_Overview_Note), Culture) ?? nameof(GameDetail_Overview_Note);
|
||||
|
||||
public static string GameDetail_Recording_Body => ResourceManager.GetString(nameof(GameDetail_Recording_Body), Culture) ?? nameof(GameDetail_Recording_Body);
|
||||
|
||||
public static string GameDetail_Recording_Header => ResourceManager.GetString(nameof(GameDetail_Recording_Header), Culture) ?? nameof(GameDetail_Recording_Header);
|
||||
@@ -1676,6 +1746,8 @@ public static class Strings
|
||||
|
||||
public static string Games_Card_NeverPlayed => ResourceManager.GetString(nameof(Games_Card_NeverPlayed), Culture) ?? nameof(Games_Card_NeverPlayed);
|
||||
|
||||
public static string Games_Card_NotInstalled => ResourceManager.GetString(nameof(Games_Card_NotInstalled), Culture) ?? nameof(Games_Card_NotInstalled);
|
||||
|
||||
public static string Games_Card_NotRecorded => ResourceManager.GetString(nameof(Games_Card_NotRecorded), Culture) ?? nameof(Games_Card_NotRecorded);
|
||||
|
||||
public static string Games_Card_Playtime_Format => ResourceManager.GetString(nameof(Games_Card_Playtime_Format), Culture) ?? nameof(Games_Card_Playtime_Format);
|
||||
@@ -1686,8 +1758,28 @@ public static class Strings
|
||||
|
||||
public static string Games_Header => ResourceManager.GetString(nameof(Games_Header), Culture) ?? nameof(Games_Header);
|
||||
|
||||
public static string Games_Header_Count_Format => ResourceManager.GetString(nameof(Games_Header_Count_Format), Culture) ?? nameof(Games_Header_Count_Format);
|
||||
|
||||
public static string Games_List_Engine => ResourceManager.GetString(nameof(Games_List_Engine), Culture) ?? nameof(Games_List_Engine);
|
||||
|
||||
public static string Games_List_LastPlayed => ResourceManager.GetString(nameof(Games_List_LastPlayed), Culture) ?? nameof(Games_List_LastPlayed);
|
||||
|
||||
public static string Games_List_Name => ResourceManager.GetString(nameof(Games_List_Name), Culture) ?? nameof(Games_List_Name);
|
||||
|
||||
public static string Games_List_Played => ResourceManager.GetString(nameof(Games_List_Played), Culture) ?? nameof(Games_List_Played);
|
||||
|
||||
public static string Games_List_Sessions => ResourceManager.GetString(nameof(Games_List_Sessions), Culture) ?? nameof(Games_List_Sessions);
|
||||
|
||||
public static string Games_List_Status => ResourceManager.GetString(nameof(Games_List_Status), Culture) ?? nameof(Games_List_Status);
|
||||
|
||||
public static string Games_List_Store => ResourceManager.GetString(nameof(Games_List_Store), Culture) ?? nameof(Games_List_Store);
|
||||
|
||||
public static string Games_NoMatch => ResourceManager.GetString(nameof(Games_NoMatch), Culture) ?? nameof(Games_NoMatch);
|
||||
|
||||
public static string Games_Refresh => ResourceManager.GetString(nameof(Games_Refresh), Culture) ?? nameof(Games_Refresh);
|
||||
|
||||
public static string Games_Refresh_ToolTip => ResourceManager.GetString(nameof(Games_Refresh_ToolTip), Culture) ?? nameof(Games_Refresh_ToolTip);
|
||||
|
||||
public static string Games_Search_Placeholder => ResourceManager.GetString(nameof(Games_Search_Placeholder), Culture) ?? nameof(Games_Search_Placeholder);
|
||||
|
||||
public static string Games_Sort_Label => ResourceManager.GetString(nameof(Games_Sort_Label), Culture) ?? nameof(Games_Sort_Label);
|
||||
@@ -1698,6 +1790,10 @@ public static class Strings
|
||||
|
||||
public static string Games_Sort_Playtime => ResourceManager.GetString(nameof(Games_Sort_Playtime), Culture) ?? nameof(Games_Sort_Playtime);
|
||||
|
||||
public static string Games_View_Grid => ResourceManager.GetString(nameof(Games_View_Grid), Culture) ?? nameof(Games_View_Grid);
|
||||
|
||||
public static string Games_View_List => ResourceManager.GetString(nameof(Games_View_List), Culture) ?? nameof(Games_View_List);
|
||||
|
||||
public static string Guard_ConsentMissing => ResourceManager.GetString(nameof(Guard_ConsentMissing), Culture) ?? nameof(Guard_ConsentMissing);
|
||||
|
||||
public static string Guard_DriverScanFailed => ResourceManager.GetString(nameof(Guard_DriverScanFailed), Culture) ?? nameof(Guard_DriverScanFailed);
|
||||
@@ -1766,12 +1862,16 @@ public static class Strings
|
||||
|
||||
public static string Import_NothingFound => ResourceManager.GetString(nameof(Import_NothingFound), Culture) ?? nameof(Import_NothingFound);
|
||||
|
||||
public static string Import_NothingNew => ResourceManager.GetString(nameof(Import_NothingNew), Culture) ?? nameof(Import_NothingNew);
|
||||
|
||||
public static string Import_SelectAll => ResourceManager.GetString(nameof(Import_SelectAll), Culture) ?? nameof(Import_SelectAll);
|
||||
|
||||
public static string Import_Selected_Format => ResourceManager.GetString(nameof(Import_Selected_Format), Culture) ?? nameof(Import_Selected_Format);
|
||||
|
||||
public static string Import_SelectNone => ResourceManager.GetString(nameof(Import_SelectNone), Culture) ?? nameof(Import_SelectNone);
|
||||
|
||||
public static string Import_ShowExisting_Format => ResourceManager.GetString(nameof(Import_ShowExisting_Format), Culture) ?? nameof(Import_ShowExisting_Format);
|
||||
|
||||
public static string Import_Title => ResourceManager.GetString(nameof(Import_Title), Culture) ?? nameof(Import_Title);
|
||||
|
||||
public static string Latency_Avg => ResourceManager.GetString(nameof(Latency_Avg), Culture) ?? nameof(Latency_Avg);
|
||||
@@ -2170,6 +2270,14 @@ public static class Strings
|
||||
|
||||
public static string Settings_Channel_Stable => ResourceManager.GetString(nameof(Settings_Channel_Stable), Culture) ?? nameof(Settings_Channel_Stable);
|
||||
|
||||
public static string Settings_Data_Header => ResourceManager.GetString(nameof(Settings_Data_Header), Culture) ?? nameof(Settings_Data_Header);
|
||||
|
||||
public static string Settings_DeleteSessions_Body => ResourceManager.GetString(nameof(Settings_DeleteSessions_Body), Culture) ?? nameof(Settings_DeleteSessions_Body);
|
||||
|
||||
public static string Settings_DeleteSessions_Button => ResourceManager.GetString(nameof(Settings_DeleteSessions_Button), Culture) ?? nameof(Settings_DeleteSessions_Button);
|
||||
|
||||
public static string Settings_DeleteSessions_Label => ResourceManager.GetString(nameof(Settings_DeleteSessions_Label), Culture) ?? nameof(Settings_DeleteSessions_Label);
|
||||
|
||||
public static string Settings_Exceptions_Body => ResourceManager.GetString(nameof(Settings_Exceptions_Body), Culture) ?? nameof(Settings_Exceptions_Body);
|
||||
|
||||
public static string Settings_Exceptions_Checking => ResourceManager.GetString(nameof(Settings_Exceptions_Checking), Culture) ?? nameof(Settings_Exceptions_Checking);
|
||||
@@ -2198,8 +2306,6 @@ public static class Strings
|
||||
|
||||
public static string Settings_HideAntiCheatHooking_Label => ResourceManager.GetString(nameof(Settings_HideAntiCheatHooking_Label), Culture) ?? nameof(Settings_HideAntiCheatHooking_Label);
|
||||
|
||||
public static string Settings_HookedGames_Empty => ResourceManager.GetString(nameof(Settings_HookedGames_Empty), Culture) ?? nameof(Settings_HookedGames_Empty);
|
||||
|
||||
public static string Settings_HookedGames_Label => ResourceManager.GetString(nameof(Settings_HookedGames_Label), Culture) ?? nameof(Settings_HookedGames_Label);
|
||||
|
||||
public static string Settings_HookedGames_Revoke => ResourceManager.GetString(nameof(Settings_HookedGames_Revoke), Culture) ?? nameof(Settings_HookedGames_Revoke);
|
||||
@@ -2220,8 +2326,6 @@ public static class Strings
|
||||
|
||||
public static string Settings_Language_Label => ResourceManager.GetString(nameof(Settings_Language_Label), Culture) ?? nameof(Settings_Language_Label);
|
||||
|
||||
public static string Settings_Language_Note => ResourceManager.GetString(nameof(Settings_Language_Note), Culture) ?? nameof(Settings_Language_Note);
|
||||
|
||||
public static string Settings_Legal_Header => ResourceManager.GetString(nameof(Settings_Legal_Header), Culture) ?? nameof(Settings_Legal_Header);
|
||||
|
||||
public static string Settings_Legal_Reopen => ResourceManager.GetString(nameof(Settings_Legal_Reopen), Culture) ?? nameof(Settings_Legal_Reopen);
|
||||
@@ -2488,6 +2592,10 @@ public static class Strings
|
||||
|
||||
public static string Trend_Excluded_Format => ResourceManager.GetString(nameof(Trend_Excluded_Format), Culture) ?? nameof(Trend_Excluded_Format);
|
||||
|
||||
public static string Trend_Extras_Label => ResourceManager.GetString(nameof(Trend_Extras_Label), Culture) ?? nameof(Trend_Extras_Label);
|
||||
|
||||
public static string Trend_Extras_Note => ResourceManager.GetString(nameof(Trend_Extras_Note), Culture) ?? nameof(Trend_Extras_Note);
|
||||
|
||||
public static string Trend_IncludeMidSession => ResourceManager.GetString(nameof(Trend_IncludeMidSession), Culture) ?? nameof(Trend_IncludeMidSession);
|
||||
|
||||
public static string Trend_Metric_Average => ResourceManager.GetString(nameof(Trend_Metric_Average), Culture) ?? nameof(Trend_Metric_Average);
|
||||
@@ -2528,6 +2636,18 @@ public static class Strings
|
||||
|
||||
public static string Trend_Partial_Note => ResourceManager.GetString(nameof(Trend_Partial_Note), Culture) ?? nameof(Trend_Partial_Note);
|
||||
|
||||
public static string Trend_Unit_Celsius => ResourceManager.GetString(nameof(Trend_Unit_Celsius), Culture) ?? nameof(Trend_Unit_Celsius);
|
||||
|
||||
public static string Trend_Unit_Factor => ResourceManager.GetString(nameof(Trend_Unit_Factor), Culture) ?? nameof(Trend_Unit_Factor);
|
||||
|
||||
public static string Trend_Unit_Fps => ResourceManager.GetString(nameof(Trend_Unit_Fps), Culture) ?? nameof(Trend_Unit_Fps);
|
||||
|
||||
public static string Trend_Unit_Megabytes => ResourceManager.GetString(nameof(Trend_Unit_Megabytes), Culture) ?? nameof(Trend_Unit_Megabytes);
|
||||
|
||||
public static string Trend_Unit_Percent => ResourceManager.GetString(nameof(Trend_Unit_Percent), Culture) ?? nameof(Trend_Unit_Percent);
|
||||
|
||||
public static string Trend_Unit_Watts => ResourceManager.GetString(nameof(Trend_Unit_Watts), Culture) ?? nameof(Trend_Unit_Watts);
|
||||
|
||||
public static string Uninstall_DataFolder_Body => ResourceManager.GetString(nameof(Uninstall_DataFolder_Body), Culture) ?? nameof(Uninstall_DataFolder_Body);
|
||||
|
||||
public static string Uninstall_DataFolder_Title => ResourceManager.GetString(nameof(Uninstall_DataFolder_Title), Culture) ?? nameof(Uninstall_DataFolder_Title);
|
||||
|
||||
@@ -145,6 +145,10 @@
|
||||
<value>ゲーム</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>ゲーム · {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>このソースのログファイルはまだありません。</value>
|
||||
<comment>review</comment>
|
||||
@@ -289,6 +293,14 @@
|
||||
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io にインストール済みのゲームは見つかりませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>新しいゲームはありません。ストアにインストールされているゲームはすべてライブラリーにあります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>ライブラリーにある {0} 件のゲームを表示する</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>{0} 件のゲームをフック無効で追加しました。{1} 件はそのままです。</value>
|
||||
<comment>review</comment>
|
||||
@@ -397,10 +409,6 @@
|
||||
<value>言語</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>すぐに適用されます。ウィンドウは新しい言語で再構築されます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>ダーク</value>
|
||||
<comment>review</comment>
|
||||
@@ -969,6 +977,54 @@
|
||||
<value>セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>すべてのセッションを削除…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>セッションの概要</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>フックした各セッションのフレームレートと Low 値(古い順)。フレーム生成が計測されたセッションでは Native と Displayed を描画します。白抜きの点はセッションの一部を表します。点をクリックすると下の一覧でそのセッションを選択します。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>{0} のすべてのセッションを削除しますか?</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>すべてのゲームのすべてのセッションを削除しますか?</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} 件のセッションを、フレームとセンサーのデータやメモとともに削除します。ゲーム、その設定、フックへの同意は残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>すべてのゲームの {0} 件のセッションを、フレームとセンサーのデータやメモとともに削除します。ライブラリー、設定、フックへの同意はすべて残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>セッションを削除</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>{1} 件のゲームの {0} 件のセッションを削除しました。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>セッションを記録中のため、何も削除していません。停止するか終了するのを待ってから、もう一度お試しください。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>キャプチャエージェントが接続されていないため、何も削除していません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>キャプチャエージェントがこの要求にまだ対応していません。再起動してからもう一度お試しください。何も削除していません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>傾向</value>
|
||||
<comment>review</comment>
|
||||
@@ -977,10 +1033,58 @@
|
||||
<value>ゲームを追加…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>更新</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>ライブラリーを読み直し、その後にインストールされたゲームをストアから探し、実行ファイルがなくなったゲームに印を付けます</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>グリッドで表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>リストで表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>名前</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>ストア</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>エンジン</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>状態</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>プレイ時間</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>最終プレイ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>記録しない</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>未インストール</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>フック無効</value>
|
||||
<comment>review</comment>
|
||||
@@ -1649,6 +1753,38 @@
|
||||
<value>指標</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>あわせて表示</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>単位は同時に2つまでです。2つ目の単位は右側の軸に描画されます(凡例に ▸ で表示)。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>×(フレーム生成)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>GPU 最高 °C</value>
|
||||
<comment>review</comment>
|
||||
@@ -1821,10 +1957,6 @@
|
||||
<value>安定版</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>フックが有効なゲームはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>フック有効なゲーム</value>
|
||||
<comment>review</comment>
|
||||
@@ -1905,6 +2037,22 @@
|
||||
<value>記録</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>データ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>すべてのセッションを削除</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>すべてのゲームのすべてのセッションを、フレームとセンサーのデータやメモとともに削除します。ライブラリー、設定、各ゲームのフックへの同意は残ります。元に戻すことはできません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>すべてのセッションを削除…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>プライバシー</value>
|
||||
<comment>review</comment>
|
||||
@@ -2350,7 +2498,7 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>保持は無制限に設定されています (設定 ▸ キャプチャ)。整理するものはありません。</value>
|
||||
<value>保持は無制限に設定されています (設定 ▸ 記録)。整理するものはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
@@ -2681,6 +2829,10 @@
|
||||
<value>検出: {0}。このゲームのフックはオフで、オンにすることはできません。セッションにはプレイ時間とセンサーの値だけが記録されます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_AntiCheat_Exceptionable_Format" xml:space="preserve">
|
||||
<value>検出: {0}。ユーザーモードの例外を作成しない限り(下記)、このゲームのフックはオフです。例外がなければ、セッションにはプレイ時間とセンサーの値だけが記録されます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Games_Card_AntiCheat" xml:space="preserve">
|
||||
<value>アンチチート</value>
|
||||
<comment>review</comment>
|
||||
@@ -3298,11 +3450,11 @@
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Label" xml:space="preserve">
|
||||
<value>以前に計測できたユーザーモードのアンチチート搭載ゲームでフックを許可する</value>
|
||||
<value>アンチチートがユーザーモードのみで動作するゲームでフックを許可する</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Body" xml:space="preserve">
|
||||
<value>既定ではオフです。オンにすると、アンチチートがユーザーモードのみで動作し(カーネルドライバーがなく、ほかに何も検出されない)、フックで2回以上計測できたゲームに、開示を確認したうえでゲームごとに例外を与えられます。ガードはすべてのチェックを続け、アカウント停止の可能性は残ります。</value>
|
||||
<value>既定ではオフです。オンにすると、アンチチートがユーザーモードのみで動作する(カーネルドライバーがなく、ほかに何も検出されない)ゲームに、開示を確認したうえでゲームごとに例外を与えられます。最初の2回のフックセッションは試用期間で、うまくいかなかったセッションが1回でもあると例外は永久に終了します。ガードはすべてのチェックを続け、アカウント停止の可能性は残ります。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Header" xml:space="preserve">
|
||||
@@ -3329,14 +3481,14 @@
|
||||
<value>{0} — {1}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_Sessions_Format" xml:space="preserve">
|
||||
<value>フック計測の成功 {0} 回</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_Granted_Format" xml:space="preserve">
|
||||
<value>{0} から例外が有効</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_GrantedTrial_Format" xml:space="preserve">
|
||||
<value>{0} から例外が有効 — 試用中: 良好なセッション {1}/{2} 回</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_Eligible" xml:space="preserve">
|
||||
<value>対象 — 例外は未作成</value>
|
||||
<comment>review</comment>
|
||||
@@ -3345,10 +3497,6 @@
|
||||
<value>確認中…</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_TooFew_Format" xml:space="preserve">
|
||||
<value>対象外: フック計測の成功は {0} 回で、2 回必要です</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_Refused_Format" xml:space="preserve">
|
||||
<value>対象外: ガードは {0}({1})も検出しました</value>
|
||||
<comment>review</comment>
|
||||
@@ -3365,6 +3513,14 @@
|
||||
<value>現在は対象外: 確認を完了できませんでした。自動で再実行されます</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_TrialFailed_Format" xml:space="preserve">
|
||||
<value>対象外: このゲームの例外は {0} に試用期間中に終了したため、再び作成することはできません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_State_NotFound_Format" xml:space="preserve">
|
||||
<value>現在は対象外: 確認時にゲームのフォルダーで {0} が見つかりませんでした。ブロックは維持されます</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_Lapsed_Format" xml:space="preserve">
|
||||
<value>直近の例外は {0} に終了しました: {1}</value>
|
||||
<comment>review</comment>
|
||||
@@ -3397,6 +3553,10 @@
|
||||
<value>例外下のセッションがクラッシュしました</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_Lapse_TrialFailed" xml:space="preserve">
|
||||
<value>試用期間中のセッションがうまくいきませんでした(フレームが記録されなかったか、正常に終了しませんでした)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Exception_Result_Granted_Format" xml:space="preserve">
|
||||
<value>{0} の例外を作成しました。計測するときは、ゲームのページでフックをオンにしてください。</value>
|
||||
<comment>review</comment>
|
||||
|
||||
@@ -114,6 +114,9 @@
|
||||
<data name="Games_Header" xml:space="preserve">
|
||||
<value>Games</value>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>Games · {0}</value>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>No log file yet for this source.</value>
|
||||
</data>
|
||||
@@ -222,6 +225,12 @@
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>No installed games were found in Steam, GOG Galaxy, Epic or itch.io on this machine.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>No new games: every game your stores have installed is already in the library.</value>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>Show the {0} games already in the library</value>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>{0} game(s) added with hooking off; {1} left as they were.</value>
|
||||
</data>
|
||||
@@ -303,9 +312,6 @@
|
||||
<data name="Settings_Language_Label" xml:space="preserve">
|
||||
<value>Language</value>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>Applies at once; the window is rebuilt in the new language.</value>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
</data>
|
||||
@@ -732,15 +738,87 @@
|
||||
<data name="GameDetail_Tab_Sessions" xml:space="preserve">
|
||||
<value>Sessions</value>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>Delete all sessions…</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>Sessions at a glance</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>Each hooked session's frame rate and lows, oldest first. Native and Displayed are drawn where frame generation was measured; a hollow point describes part of its session. Click a point to select its session below.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>Delete every session of {0}?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>Delete every session of every game?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} session(s), with their frame and sensor data and their notes, are deleted. The game, its settings and its hooking consent stay. This cannot be undone.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>{0} session(s) of every game, with their frame and sensor data and their notes, are deleted. The library, your settings and every hooking consent stay. This cannot be undone.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>Delete sessions</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>Deleted {0} session(s) of {1} game(s).</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>A session is being recorded, so nothing was deleted. Stop it or let it end, then try again.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>The capture agent is not connected, so nothing was deleted.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>The capture agent does not know this request yet; restart it and try again. Nothing was deleted.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>Trend</value>
|
||||
</data>
|
||||
<data name="Games_Add" xml:space="preserve">
|
||||
<value>Add game…</value>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>Read the library again, look in your stores for games installed since, and mark games whose executable is gone</value>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>Show as a grid</value>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>Show as a list</value>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>Name</value>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>Store</value>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>Engine</value>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>Status</value>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>Sessions</value>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>Played</value>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>Last played</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>Not recorded</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>Not installed</value>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>Hooking off</value>
|
||||
</data>
|
||||
@@ -1242,6 +1320,30 @@
|
||||
<data name="Trend_Metric_Label" xml:space="preserve">
|
||||
<value>Metric</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>Also draw</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>Up to two units at once: a second unit is drawn against the right axis (marked ▸ in the legend).</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>× (frame generation)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>Max GPU °C</value>
|
||||
</data>
|
||||
@@ -1371,9 +1473,6 @@
|
||||
<data name="Settings_Channel_Stable" xml:space="preserve">
|
||||
<value>Stable</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>No game has hooking on.</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>Games with hooking on</value>
|
||||
</data>
|
||||
@@ -1434,6 +1533,18 @@
|
||||
<data name="Settings_Policy_Header" xml:space="preserve">
|
||||
<value>Recording</value>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>Data</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>Delete all sessions</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>Every session of every game, with its frame and sensor data and its notes. The library, your settings and each game's hooking consent stay. It cannot be undone.</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>Delete all sessions…</value>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>Privacy</value>
|
||||
</data>
|
||||
@@ -1768,7 +1879,7 @@
|
||||
<value>Sweep…</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>Retention is unlimited (Settings ▸ Capture), so there is nothing to sweep.</value>
|
||||
<value>Retention is unlimited (Settings ▸ Recording), so there is nothing to sweep.</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
<value>The Agent is not connected. The raw data is the Agent's to remove; start it and try again.</value>
|
||||
@@ -2021,6 +2132,9 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="GameDetail_AntiCheat_Format" xml:space="preserve">
|
||||
<value>Found: {0}. Hooking is off for this game and cannot be turned on; its sessions record play time and sensors only.</value>
|
||||
</data>
|
||||
<data name="GameDetail_AntiCheat_Exceptionable_Format" xml:space="preserve">
|
||||
<value>Found: {0}. Hooking is off for this game unless you make a user-mode exception for it (below); without one, its sessions record play time and sensors only.</value>
|
||||
</data>
|
||||
<data name="Games_Card_AntiCheat" xml:space="preserve">
|
||||
<value>Anti-cheat</value>
|
||||
</data>
|
||||
@@ -2484,10 +2598,10 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Label" xml:space="preserve">
|
||||
<value>Allow hooking in games with user-mode anti-cheat that were measured before</value>
|
||||
<value>Allow hooking in games whose only anti-cheat runs in user mode</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Body" xml:space="preserve">
|
||||
<value>Off by default. On, a game whose only anti-cheat runs in user mode — no kernel driver, nothing else found — and that was measured hooked at least twice can be given an exception below, one game at a time, after a disclosure. The guard still runs every check, and a ban remains possible.</value>
|
||||
<value>Off by default. On, a game whose only anti-cheat runs in user mode — no kernel driver, nothing else found — can be given an exception below, one game at a time, after a disclosure. Its first two hooked sessions are a trial: one that does not go well ends the exception for good. The guard still runs every check, and a ban remains possible.</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Header" xml:space="preserve">
|
||||
<value>User-mode exceptions</value>
|
||||
@@ -2507,21 +2621,18 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Exception_Finding_Format" xml:space="preserve">
|
||||
<value>{0} — {1}</value>
|
||||
</data>
|
||||
<data name="Exception_Sessions_Format" xml:space="preserve">
|
||||
<value>{0} successful hooked sessions</value>
|
||||
</data>
|
||||
<data name="Exception_State_Granted_Format" xml:space="preserve">
|
||||
<value>Exception in force since {0}</value>
|
||||
</data>
|
||||
<data name="Exception_State_GrantedTrial_Format" xml:space="preserve">
|
||||
<value>Exception in force since {0} — trial: {1} of {2} good sessions so far</value>
|
||||
</data>
|
||||
<data name="Exception_State_Eligible" xml:space="preserve">
|
||||
<value>Eligible — no exception made</value>
|
||||
</data>
|
||||
<data name="Exception_State_Checking" xml:space="preserve">
|
||||
<value>Checking…</value>
|
||||
</data>
|
||||
<data name="Exception_State_TooFew_Format" xml:space="preserve">
|
||||
<value>Not eligible: {0} successful hooked session(s), two are needed</value>
|
||||
</data>
|
||||
<data name="Exception_State_Refused_Format" xml:space="preserve">
|
||||
<value>Not eligible: the guard also found {0} ({1})</value>
|
||||
</data>
|
||||
@@ -2534,6 +2645,12 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Exception_State_CouldNotVerify" xml:space="preserve">
|
||||
<value>Not eligible now: the check could not finish; it runs again by itself</value>
|
||||
</data>
|
||||
<data name="Exception_State_TrialFailed_Format" xml:space="preserve">
|
||||
<value>Not eligible: an exception of this game ended during its trial on {0}, so none can be made again</value>
|
||||
</data>
|
||||
<data name="Exception_State_NotFound_Format" xml:space="preserve">
|
||||
<value>Not eligible now: {0} was not found in the game's folder when it was checked; the block stays</value>
|
||||
</data>
|
||||
<data name="Exception_Lapsed_Format" xml:space="preserve">
|
||||
<value>The last exception ended on {0}: {1}</value>
|
||||
</data>
|
||||
@@ -2558,6 +2675,9 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="Exception_Lapse_SessionCrashed" xml:space="preserve">
|
||||
<value>a session under it crashed</value>
|
||||
</data>
|
||||
<data name="Exception_Lapse_TrialFailed" xml:space="preserve">
|
||||
<value>a session during its trial did not go well (no frames recorded, or it did not end normally)</value>
|
||||
</data>
|
||||
<data name="Exception_Result_Granted_Format" xml:space="preserve">
|
||||
<value>Exception made for {0}. Turn hooking on for the game on its page when you want to measure it.</value>
|
||||
</data>
|
||||
|
||||
@@ -109,6 +109,9 @@
|
||||
<data name="Games_Header" xml:space="preserve">
|
||||
<value>Game</value>
|
||||
</data>
|
||||
<data name="Games_Header_Count_Format" xml:space="preserve">
|
||||
<value>Game · {0}</value>
|
||||
</data>
|
||||
<data name="Logs_Empty" xml:space="preserve">
|
||||
<value>Chưa có tệp nhật ký cho nguồn này.</value>
|
||||
</data>
|
||||
@@ -217,6 +220,12 @@
|
||||
<data name="Import_NothingFound" xml:space="preserve">
|
||||
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic hay itch.io trên máy này.</value>
|
||||
</data>
|
||||
<data name="Import_NothingNew" xml:space="preserve">
|
||||
<value>Không có game mới: mọi game các store đã cài đều đã có trong thư viện.</value>
|
||||
</data>
|
||||
<data name="Import_ShowExisting_Format" xml:space="preserve">
|
||||
<value>Hiện {0} game đã có trong thư viện</value>
|
||||
</data>
|
||||
<data name="Import_Done_Format" xml:space="preserve">
|
||||
<value>Đã thêm {0} game với hooking tắt; {1} giữ nguyên.</value>
|
||||
</data>
|
||||
@@ -298,9 +307,6 @@
|
||||
<data name="Settings_Language_Label" xml:space="preserve">
|
||||
<value>Ngôn ngữ</value>
|
||||
</data>
|
||||
<data name="Settings_Language_Note" xml:space="preserve">
|
||||
<value>Áp dụng ngay; cửa sổ được dựng lại bằng ngôn ngữ mới.</value>
|
||||
</data>
|
||||
<data name="Settings_Theme_Dark" xml:space="preserve">
|
||||
<value>Tối</value>
|
||||
</data>
|
||||
@@ -727,15 +733,87 @@
|
||||
<data name="GameDetail_Tab_Sessions" xml:space="preserve">
|
||||
<value>Phiên chơi</value>
|
||||
</data>
|
||||
<data name="GameDetail_DeleteSessions" xml:space="preserve">
|
||||
<value>Xoá mọi phiên…</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Header" xml:space="preserve">
|
||||
<value>Tổng quan các phiên</value>
|
||||
</data>
|
||||
<data name="GameDetail_Overview_Note" xml:space="preserve">
|
||||
<value>Tốc độ khung hình và các mức thấp của mỗi phiên có hook, cũ nhất trước. Native và Displayed được vẽ ở phiên đo được frame generation; điểm rỗng mô tả một phần phiên. Bấm vào một điểm để chọn phiên đó bên dưới.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameTitle_Format" xml:space="preserve">
|
||||
<value>Xoá mọi phiên của {0}?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllTitle" xml:space="preserve">
|
||||
<value>Xoá mọi phiên của mọi game?</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_GameBody_Format" xml:space="preserve">
|
||||
<value>{0} phiên, kèm dữ liệu frame, cảm biến và ghi chú, sẽ bị xoá. Game, cài đặt và consent hooking của nó vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AllBody_Format" xml:space="preserve">
|
||||
<value>{0} phiên của mọi game, kèm dữ liệu frame, cảm biến và ghi chú, sẽ bị xoá. Thư viện, cài đặt và mọi consent hooking vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Delete" xml:space="preserve">
|
||||
<value>Xoá phiên</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Done_Format" xml:space="preserve">
|
||||
<value>Đã xoá {0} phiên của {1} game.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_Running" xml:space="preserve">
|
||||
<value>Đang ghi một phiên nên chưa xoá gì. Hãy dừng hoặc chờ phiên kết thúc rồi thử lại.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_NoAgent" xml:space="preserve">
|
||||
<value>Agent ghi chưa kết nối nên chưa xoá gì.</value>
|
||||
</data>
|
||||
<data name="DeleteSessions_AgentTooOld" xml:space="preserve">
|
||||
<value>Agent ghi chưa hỗ trợ yêu cầu này; hãy khởi động lại rồi thử lại. Chưa xoá gì.</value>
|
||||
</data>
|
||||
<data name="GameDetail_Tab_Trend" xml:space="preserve">
|
||||
<value>Xu hướng</value>
|
||||
</data>
|
||||
<data name="Games_Add" xml:space="preserve">
|
||||
<value>Thêm game…</value>
|
||||
</data>
|
||||
<data name="Games_Refresh" xml:space="preserve">
|
||||
<value>Làm mới</value>
|
||||
</data>
|
||||
<data name="Games_Refresh_ToolTip" xml:space="preserve">
|
||||
<value>Đọc lại thư viện, tìm trong các store những game mới cài, và đánh dấu game không còn file chạy</value>
|
||||
</data>
|
||||
<data name="Games_View_Grid" xml:space="preserve">
|
||||
<value>Hiển thị dạng lưới</value>
|
||||
</data>
|
||||
<data name="Games_View_List" xml:space="preserve">
|
||||
<value>Hiển thị dạng danh sách</value>
|
||||
</data>
|
||||
<data name="Games_List_Name" xml:space="preserve">
|
||||
<value>Tên</value>
|
||||
</data>
|
||||
<data name="Games_List_Store" xml:space="preserve">
|
||||
<value>Store</value>
|
||||
</data>
|
||||
<data name="Games_List_Engine" xml:space="preserve">
|
||||
<value>Engine</value>
|
||||
</data>
|
||||
<data name="Games_List_Status" xml:space="preserve">
|
||||
<value>Trạng thái</value>
|
||||
</data>
|
||||
<data name="Games_List_Sessions" xml:space="preserve">
|
||||
<value>Phiên</value>
|
||||
</data>
|
||||
<data name="Games_List_Played" xml:space="preserve">
|
||||
<value>Đã chơi</value>
|
||||
</data>
|
||||
<data name="Games_List_LastPlayed" xml:space="preserve">
|
||||
<value>Chơi lần cuối</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotRecorded" xml:space="preserve">
|
||||
<value>Không ghi</value>
|
||||
</data>
|
||||
<data name="Games_Card_NotInstalled" xml:space="preserve">
|
||||
<value>Chưa cài</value>
|
||||
</data>
|
||||
<data name="Games_Card_HookOff" xml:space="preserve">
|
||||
<value>Hooking tắt</value>
|
||||
</data>
|
||||
@@ -1237,6 +1315,30 @@
|
||||
<data name="Trend_Metric_Label" xml:space="preserve">
|
||||
<value>Chỉ số</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Label" xml:space="preserve">
|
||||
<value>Vẽ thêm</value>
|
||||
</data>
|
||||
<data name="Trend_Extras_Note" xml:space="preserve">
|
||||
<value>Tối đa hai đơn vị cùng lúc: đơn vị thứ hai được vẽ theo trục bên phải (đánh dấu ▸ trong chú thích).</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Fps" xml:space="preserve">
|
||||
<value>FPS</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Celsius" xml:space="preserve">
|
||||
<value>°C</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Percent" xml:space="preserve">
|
||||
<value>%</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Watts" xml:space="preserve">
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Megabytes" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Trend_Unit_Factor" xml:space="preserve">
|
||||
<value>× (frame generation)</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_MaxGpuTemp" xml:space="preserve">
|
||||
<value>GPU tối đa °C</value>
|
||||
</data>
|
||||
@@ -1366,9 +1468,6 @@
|
||||
<data name="Settings_Channel_Stable" xml:space="preserve">
|
||||
<value>Ổn định</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Empty" xml:space="preserve">
|
||||
<value>Chưa có game nào bật hooking.</value>
|
||||
</data>
|
||||
<data name="Settings_HookedGames_Label" xml:space="preserve">
|
||||
<value>Game đang bật hooking</value>
|
||||
</data>
|
||||
@@ -1429,6 +1528,18 @@
|
||||
<data name="Settings_Policy_Header" xml:space="preserve">
|
||||
<value>Ghi phiên</value>
|
||||
</data>
|
||||
<data name="Settings_Data_Header" xml:space="preserve">
|
||||
<value>Dữ liệu</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Label" xml:space="preserve">
|
||||
<value>Xoá mọi phiên</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Body" xml:space="preserve">
|
||||
<value>Mọi phiên của mọi game, kèm dữ liệu frame, cảm biến và ghi chú. Thư viện, cài đặt và consent hooking của từng game vẫn giữ nguyên. Không thể hoàn tác.</value>
|
||||
</data>
|
||||
<data name="Settings_DeleteSessions_Button" xml:space="preserve">
|
||||
<value>Xoá mọi phiên…</value>
|
||||
</data>
|
||||
<data name="Settings_Privacy_Header" xml:space="preserve">
|
||||
<value>Quyền riêng tư</value>
|
||||
</data>
|
||||
@@ -1763,7 +1874,7 @@
|
||||
<value>Dọn dẹp…</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_Unlimited" xml:space="preserve">
|
||||
<value>Lưu giữ đang là không giới hạn (Cài đặt ▸ Ghi), nên không có gì để dọn.</value>
|
||||
<value>Lưu giữ đang là không giới hạn (Cài đặt ▸ Ghi phiên), nên không có gì để dọn.</value>
|
||||
</data>
|
||||
<data name="Maintenance_Sweep_NoAgent" xml:space="preserve">
|
||||
<value>Agent chưa kết nối. Dữ liệu thô do Agent xoá; hãy khởi động Agent rồi thử lại.</value>
|
||||
@@ -2016,6 +2127,9 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<data name="GameDetail_AntiCheat_Format" xml:space="preserve">
|
||||
<value>Đã phát hiện: {0}. Hooking đã tắt cho game này và không thể bật; các phiên của nó chỉ ghi thời gian chơi và cảm biến.</value>
|
||||
</data>
|
||||
<data name="GameDetail_AntiCheat_Exceptionable_Format" xml:space="preserve">
|
||||
<value>Đã phát hiện: {0}. Hooking đã tắt cho game này trừ khi bạn tạo ngoại lệ user-mode cho nó (bên dưới); nếu không, các phiên của nó chỉ ghi thời gian chơi và cảm biến.</value>
|
||||
</data>
|
||||
<data name="Games_Card_AntiCheat" xml:space="preserve">
|
||||
<value>Anti-cheat</value>
|
||||
</data>
|
||||
@@ -2479,10 +2593,10 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<value>W</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Label" xml:space="preserve">
|
||||
<value>Cho phép hooking ở game có anti-cheat user-mode đã từng đo thành công</value>
|
||||
<value>Cho phép hooking ở game chỉ có anti-cheat chạy ở user mode</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Body" xml:space="preserve">
|
||||
<value>Mặc định tắt. Khi bật, game có anti-cheat duy nhất chạy ở user mode — không có kernel driver, không phát hiện gì khác — và đã được đo ở chế độ hook ít nhất hai lần có thể được cấp ngoại lệ bên dưới, từng game một, sau một bản công bố rủi ro. Bộ bảo vệ vẫn chạy mọi bước kiểm tra, và vẫn có thể bị khoá tài khoản.</value>
|
||||
<value>Mặc định tắt. Khi bật, game có anti-cheat duy nhất chạy ở user mode — không có kernel driver, không phát hiện gì khác — có thể được cấp ngoại lệ bên dưới, từng game một, sau một bản công bố rủi ro. Hai phiên hook đầu tiên là phiên thử: một phiên không ổn sẽ kết thúc ngoại lệ vĩnh viễn. Bộ bảo vệ vẫn chạy mọi bước kiểm tra, và vẫn có thể bị khoá tài khoản.</value>
|
||||
</data>
|
||||
<data name="Settings_Exceptions_Header" xml:space="preserve">
|
||||
<value>Ngoại lệ user-mode</value>
|
||||
@@ -2502,21 +2616,18 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<data name="Exception_Finding_Format" xml:space="preserve">
|
||||
<value>{0} — {1}</value>
|
||||
</data>
|
||||
<data name="Exception_Sessions_Format" xml:space="preserve">
|
||||
<value>{0} phiên hook thành công</value>
|
||||
</data>
|
||||
<data name="Exception_State_Granted_Format" xml:space="preserve">
|
||||
<value>Ngoại lệ có hiệu lực từ {0}</value>
|
||||
</data>
|
||||
<data name="Exception_State_GrantedTrial_Format" xml:space="preserve">
|
||||
<value>Ngoại lệ có hiệu lực từ {0} — đang thử: đã có {1}/{2} phiên tốt</value>
|
||||
</data>
|
||||
<data name="Exception_State_Eligible" xml:space="preserve">
|
||||
<value>Đủ điều kiện — chưa tạo ngoại lệ</value>
|
||||
</data>
|
||||
<data name="Exception_State_Checking" xml:space="preserve">
|
||||
<value>Đang kiểm tra…</value>
|
||||
</data>
|
||||
<data name="Exception_State_TooFew_Format" xml:space="preserve">
|
||||
<value>Chưa đủ điều kiện: {0} phiên hook thành công, cần hai</value>
|
||||
</data>
|
||||
<data name="Exception_State_Refused_Format" xml:space="preserve">
|
||||
<value>Không đủ điều kiện: bộ bảo vệ còn phát hiện {0} ({1})</value>
|
||||
</data>
|
||||
@@ -2529,6 +2640,12 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<data name="Exception_State_CouldNotVerify" xml:space="preserve">
|
||||
<value>Hiện chưa đủ điều kiện: lần kiểm tra không hoàn tất; nó sẽ tự chạy lại</value>
|
||||
</data>
|
||||
<data name="Exception_State_TrialFailed_Format" xml:space="preserve">
|
||||
<value>Không đủ điều kiện: một ngoại lệ của game này đã kết thúc trong thời gian thử vào {0}, nên không thể tạo lại</value>
|
||||
</data>
|
||||
<data name="Exception_State_NotFound_Format" xml:space="preserve">
|
||||
<value>Hiện không đủ điều kiện: lúc kiểm tra không thấy {0} trong thư mục game; lệnh chặn vẫn giữ nguyên</value>
|
||||
</data>
|
||||
<data name="Exception_Lapsed_Format" xml:space="preserve">
|
||||
<value>Ngoại lệ gần nhất đã kết thúc ngày {0}: {1}</value>
|
||||
</data>
|
||||
@@ -2553,6 +2670,9 @@ Các tài liệu bên dưới là điều khoản đầy đủ; phần tóm tắ
|
||||
<data name="Exception_Lapse_SessionCrashed" xml:space="preserve">
|
||||
<value>một phiên dưới ngoại lệ bị crash</value>
|
||||
</data>
|
||||
<data name="Exception_Lapse_TrialFailed" xml:space="preserve">
|
||||
<value>một phiên trong thời gian thử không ổn (không ghi được frame nào, hoặc không kết thúc bình thường)</value>
|
||||
</data>
|
||||
<data name="Exception_Result_Granted_Format" xml:space="preserve">
|
||||
<value>Đã tạo ngoại lệ cho {0}. Khi muốn đo, hãy bật hooking cho game trên trang của nó.</value>
|
||||
</data>
|
||||
|
||||
@@ -6,8 +6,8 @@ using SafetyStrings = FrameLedger.Shared.Strings;
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// D33's disclosure content (<c>19_SAFETY</c> §The user-mode exception): why the exception is offered, the risk at the same
|
||||
/// grain as FR-2.1's dialog, what is still refused, how it ends, and that it turns nothing on. <see cref="Accepted"/> — the
|
||||
/// D33's disclosure content (<c>19_SAFETY</c> §The user-mode exception): why the exception is offered, its trial (D38), the
|
||||
/// risk at the same grain as FR-2.1's dialog, what is still refused, how it ends, and that it turns nothing on. <see cref="Accepted"/> — the
|
||||
/// user ticking "I accept the risk of a ban for this game" — is the one thing that enables the dialog's primary button.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
@@ -22,7 +22,7 @@ public sealed partial class AntiCheatExceptionDialogViewModel : ObservableObject
|
||||
Facts = facts;
|
||||
Title = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Title_Format, facts.GameName);
|
||||
Intro = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Intro_Format, facts.Family, facts.Signal);
|
||||
Why = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Why_Format, facts.Family, facts.Sessions);
|
||||
Why = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Why_Format, facts.Family);
|
||||
Risk = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Risk_Format, facts.Family);
|
||||
Still = string.Format(CultureInfo.CurrentCulture, SafetyStrings.Safety_Exception_Still_Format, facts.Family);
|
||||
}
|
||||
@@ -39,6 +39,9 @@ public sealed partial class AntiCheatExceptionDialogViewModel : ObservableObject
|
||||
|
||||
public string Still { get; }
|
||||
|
||||
/// <summary>D38: the grant's first two sessions are a trial, and one that does not go well ends it for good.</summary>
|
||||
public static string Trial => SafetyStrings.Safety_Exception_Trial;
|
||||
|
||||
public static string Ends => SafetyStrings.Safety_Exception_Ends;
|
||||
|
||||
public static string Next => SafetyStrings.Safety_Exception_Next;
|
||||
|
||||
@@ -5,8 +5,9 @@ using FrameLedger.App.Services;
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One row of Settings ▸ Capture's user-mode exception list (D33): the game, what was found, the evidence, the state — and
|
||||
/// the one action the state allows, making the exception (through its disclosure) or withdrawing it.
|
||||
/// One row of Settings ▸ Capture's user-mode exception list (D33): the game, what was found, the state — which carries a
|
||||
/// grant's trial since D38, so no separate count line repeats it — and the one action the state allows, making the
|
||||
/// exception (through its disclosure) or withdrawing it.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed partial class ExceptionGameViewModel
|
||||
@@ -23,7 +24,6 @@ public sealed partial class ExceptionGameViewModel
|
||||
_grant = grant ?? throw new ArgumentNullException(nameof(grant));
|
||||
_withdraw = withdraw ?? throw new ArgumentNullException(nameof(withdraw));
|
||||
FindingText = string.Format(CultureInfo.CurrentCulture, Strings.Exception_Finding_Format, view.Family ?? Strings.Common_NotAvailable, view.Signal ?? Strings.Common_NotAvailable);
|
||||
SessionsText = string.Format(CultureInfo.CurrentCulture, Strings.Exception_Sessions_Format, view.Sessions);
|
||||
}
|
||||
|
||||
public long GameId { get; }
|
||||
@@ -34,8 +34,6 @@ public sealed partial class ExceptionGameViewModel
|
||||
|
||||
public string FindingText { get; }
|
||||
|
||||
public string SessionsText { get; }
|
||||
|
||||
public string StateText => View.Text;
|
||||
|
||||
public string? LapseText => View.LapseText;
|
||||
|
||||
@@ -5,17 +5,21 @@ using FrameLedger.App.Services;
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One library card (<c>08_UI</c> §Games): name, platform and engine badges, playtime, last played, hooking state — or, since
|
||||
/// 2026-09-23, "Not recorded" in its place for an entry whose recording is off, and since 2026-09-25 "Anti-cheat" for one
|
||||
/// the guard found anti-cheat in. The sparkline is PR-6's.
|
||||
/// One library entry (<c>08_UI</c> §Games), as a card in the grid or a row in the list: name, platform and engine badges,
|
||||
/// playtime, last played, hooking state — or, since 2026-09-23, "Not recorded" in its place for an entry whose recording is
|
||||
/// off, and since 2026-09-25 "Anti-cheat" for one the guard found anti-cheat in; since beta.11 "Not installed" beside it
|
||||
/// when its executable is not on disk (<see cref="GameLibrary.ExecutableExists"/>, read when the library is listed, never
|
||||
/// stored), with the game page's own words for why (<see cref="Formats.ExecutableMissingText"/>).
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed class GameCardViewModel
|
||||
{
|
||||
public GameCardViewModel(GameCard card)
|
||||
public GameCardViewModel(GameCard card, bool installed = true)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(card);
|
||||
Card = card;
|
||||
NotInstalled = !installed;
|
||||
NotInstalledToolTip = installed ? null : Formats.ExecutableMissingText(card.Row.Fingerprint.ExePath);
|
||||
Id = card.Row.Id;
|
||||
Name = card.Row.Name;
|
||||
PlatformText = Formats.Platform(card.Row.Platform);
|
||||
@@ -36,7 +40,9 @@ public sealed class GameCardViewModel
|
||||
TotalSeconds = card.Summary?.TotalSeconds ?? 0;
|
||||
LastPlayedAt = card.Summary?.LastPlayedAt;
|
||||
SessionsText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Sessions_Format, SessionCount);
|
||||
PlaytimeText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Playtime_Format, Formats.Playtime(TotalSeconds));
|
||||
PlaytimeValue = Formats.Playtime(TotalSeconds);
|
||||
PlaytimeText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_Playtime_Format, PlaytimeValue);
|
||||
LastPlayedValue = LastPlayedAt is DateTimeOffset when ? Formats.Date(when) : Strings.Games_Card_NeverPlayed;
|
||||
LastPlayedText = LastPlayedAt is DateTimeOffset at
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Games_Card_LastPlayed_Format, Formats.Date(at))
|
||||
: Strings.Games_Card_NeverPlayed;
|
||||
@@ -83,4 +89,19 @@ public sealed class GameCardViewModel
|
||||
public string PlaytimeText { get; }
|
||||
|
||||
public string LastPlayedText { get; }
|
||||
|
||||
/// <summary>The list view's playtime cell: the duration alone.</summary>
|
||||
public string PlaytimeValue { get; }
|
||||
|
||||
/// <summary>The list view's last-played cell: the date alone, or "not played yet".</summary>
|
||||
public string LastPlayedValue { get; }
|
||||
|
||||
/// <summary>beta.11: the "Not installed" pill shows — the file, or the drive it was on, is not there now.</summary>
|
||||
public bool NotInstalled { get; }
|
||||
|
||||
/// <summary>What the pill means here — the drive that is not connected, or the path the file is gone from; null when installed.</summary>
|
||||
public string? NotInstalledToolTip { get; }
|
||||
|
||||
/// <summary>The list view's status cell: what the hook pill says, and "Not installed" after it when that is so.</summary>
|
||||
public string StatusText => NotInstalled ? HookText + " · " + Strings.Games_Card_NotInstalled : HookText;
|
||||
}
|
||||
@@ -43,6 +43,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
private readonly SessionSelection _selection;
|
||||
private readonly RegisteredSettings? _settings;
|
||||
private readonly AntiCheatExceptions? _exceptions;
|
||||
private readonly SessionDeletion? _deletion;
|
||||
private readonly long? _gameId;
|
||||
|
||||
// ui.hide_anticheat_hooking (2026-09-25), read at each load; on until the settings say otherwise, as its default is.
|
||||
@@ -196,14 +197,19 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _trendEmpty = true;
|
||||
|
||||
/// <summary>beta.11 (D39): whether the Sessions tab's overview has anything to draw.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _overviewVisible;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _trendExcludedText = string.Empty;
|
||||
|
||||
public GameDetailViewModel(GameLibrary library, GameSelection selection, HookingConsent consent, IPageNavigator navigator,
|
||||
IConfirmations confirmations, IEditGamePrompt edit, IMessageStrip strip, ISessionSummaryOpener summaries,
|
||||
SessionSeriesLoader loader, IHardwareSnapshotRepository hardware, SessionSelection sessionSelection, IGamePicker picker,
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, AntiCheatExceptions? exceptions = null)
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, AntiCheatExceptions? exceptions = null, SessionDeletion? deletion = null)
|
||||
{
|
||||
_deletion = deletion;
|
||||
_exceptions = exceptions;
|
||||
_settings = settings;
|
||||
_agent = agent;
|
||||
@@ -345,6 +351,28 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
|
||||
public IReadOnlyList<TrendPoint> TrendPoints { get; private set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D39): what the Trend draws — the selected metric, then every metric ticked beside it. One line alone keeps
|
||||
/// its own name on the axis, as before; several are labelled by unit, a second unit on the right.
|
||||
/// </summary>
|
||||
public IReadOnlyList<TrendLine> TrendLines { get; private set; } = [];
|
||||
|
||||
/// <summary>beta.11 (D39): the metrics that can be drawn beside the selected one, ticked by the user.</summary>
|
||||
public ObservableCollection<TrendMetricOptionViewModel> TrendExtras { get; } = [];
|
||||
|
||||
/// <summary>beta.11 (D39): the Sessions tab's overview — every hooked session's rate and lows (<see cref="TrendSeriesBuilder.Overview"/>).</summary>
|
||||
public IReadOnlyList<TrendLine> OverviewLines { get; private set; } = [];
|
||||
|
||||
public static string TrendExtrasLabel => Strings.Trend_Extras_Label;
|
||||
|
||||
public static string TrendExtrasNote => Strings.Trend_Extras_Note;
|
||||
|
||||
public static string OverviewHeader => Strings.GameDetail_Overview_Header;
|
||||
|
||||
public static string OverviewNote => Strings.GameDetail_Overview_Note;
|
||||
|
||||
public static string DeleteAllSessionsText => Strings.GameDetail_DeleteSessions;
|
||||
|
||||
public IReadOnlyList<HardwareChange> HardwareChanges { get; private set; } = [];
|
||||
|
||||
public string TrendMetricText => TrendMetrics.First(c => c.Value == TrendMetric).Label;
|
||||
@@ -526,12 +554,92 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
TrendPoints = TrendSeriesBuilder.Points(_detail.Sessions, TrendMetric, IncludeMidSession);
|
||||
int excluded = IncludeMidSession ? 0 : TrendSeriesBuilder.ExcludedCount(_detail.Sessions, TrendMetric);
|
||||
TrendExcludedText = excluded > 0 ? string.Format(CultureInfo.CurrentCulture, Strings.Trend_Excluded_Format, excluded) : string.Empty;
|
||||
TrendEmpty = TrendPoints.Count == 0;
|
||||
TrendLines = BuildTrendLines();
|
||||
TrendEmpty = TrendLines.All(static l => l.Points.Count == 0);
|
||||
TrendEmptyMessage = string.Format(CultureInfo.CurrentCulture, Strings.Trend_Empty_Format, TrendMetricText);
|
||||
OverviewLines = TrendSeriesBuilder.Overview(_detail.Sessions);
|
||||
OverviewVisible = OverviewLines.Count > 0;
|
||||
OnPropertyChanged(nameof(TrendMetricText));
|
||||
TrendPresented?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D39): the selected metric's line, then each ticked metric's — and the options' state: the selected metric
|
||||
/// is not offered beside itself, and once two units are on the chart a metric in a third cannot be ticked. A metric
|
||||
/// ticked in a third unit — the selected one changed to a unit neither ticked unit shares — is unticked: the chart
|
||||
/// draws two units, and a box left ticked would name a line that is not there.
|
||||
/// </summary>
|
||||
private List<TrendLine> BuildTrendLines()
|
||||
{
|
||||
if (TrendExtras.Count == 0)
|
||||
{
|
||||
foreach (Choice<TrendMetric> choice in TrendMetrics)
|
||||
{
|
||||
var option = new TrendMetricOptionViewModel(choice.Value, choice.Label, TrendSeriesBuilder.UnitOf(choice.Value));
|
||||
option.PropertyChanged += OnTrendExtraChanged;
|
||||
TrendExtras.Add(option);
|
||||
}
|
||||
}
|
||||
|
||||
_rebuildingExtras = true;
|
||||
try
|
||||
{
|
||||
string primaryUnit = TrendSeriesBuilder.UnitOf(TrendMetric);
|
||||
string? secondUnit = null;
|
||||
foreach (TrendMetricOptionViewModel option in TrendExtras.Where(o => o.IsSelected))
|
||||
{
|
||||
if (option.Metric == TrendMetric)
|
||||
{
|
||||
option.IsSelected = false;
|
||||
}
|
||||
else if (!string.Equals(option.Unit, primaryUnit, StringComparison.Ordinal))
|
||||
{
|
||||
secondUnit ??= option.Unit;
|
||||
option.IsSelected = string.Equals(option.Unit, secondUnit, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
TrendMetricOptionViewModel[] ticked = [.. TrendExtras.Where(static o => o.IsSelected)];
|
||||
HashSet<string> units = [primaryUnit, .. ticked.Select(static o => o.Unit)];
|
||||
foreach (TrendMetricOptionViewModel option in TrendExtras)
|
||||
{
|
||||
option.IsEnabled = option.Metric != TrendMetric && (option.IsSelected || units.Count < 2 || units.Contains(option.Unit));
|
||||
}
|
||||
|
||||
if (ticked.Length == 0)
|
||||
{
|
||||
return [new TrendLine(TrendMetricText, TrendMetricText, TrendPoints)];
|
||||
}
|
||||
|
||||
List<TrendLine> lines = [new TrendLine(TrendMetricText, primaryUnit, TrendPoints)];
|
||||
lines.AddRange(ticked.Select(o => new TrendLine(o.Label, o.Unit, TrendSeriesBuilder.Points(_detail!.Sessions, o.Metric, IncludeMidSession))));
|
||||
return lines;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_rebuildingExtras = false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool _rebuildingExtras;
|
||||
|
||||
private void OnTrendExtraChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (!_rebuildingExtras && string.Equals(e.PropertyName, nameof(TrendMetricOptionViewModel.IsSelected), StringComparison.Ordinal))
|
||||
{
|
||||
RebuildTrendPoints();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D39): a click on the Sessions tab's overview selects that session in the grid.</summary>
|
||||
public void SelectSession(long sessionId)
|
||||
{
|
||||
if (Sessions.FirstOrDefault(s => s.Row.Id == sessionId) is { } session)
|
||||
{
|
||||
SelectedSession = session;
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void Back() => _navigator.Navigate<GamesPage>();
|
||||
|
||||
@@ -567,6 +675,10 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
private Task RemoveAsync() => RunAsync(RemoveCoreAsync);
|
||||
|
||||
/// <summary>beta.11 (D40): every session of this game, after the confirmation; the game, its settings and its consent stay.</summary>
|
||||
[RelayCommand]
|
||||
private Task DeleteAllSessionsAsync() => RunAsync(DeleteAllSessionsCoreAsync);
|
||||
|
||||
[RelayCommand]
|
||||
private Task ChangeExecutableAsync() => RunAsync(ChangeExecutableCoreAsync);
|
||||
|
||||
@@ -694,6 +806,27 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
await LoadAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task DeleteAllSessionsCoreAsync()
|
||||
{
|
||||
if (Game is null || Sessions.Count == 0 || !await _confirmations.DeleteSessionsAsync(Game.Name, Sessions.Count).ConfigureAwait(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SessionDeletionResult result = _deletion is null
|
||||
? new(SessionDeletionOutcome.AgentUnavailable)
|
||||
: await _deletion.DeleteAsync(Game.Id).ConfigureAwait(true);
|
||||
if (!result.Succeeded)
|
||||
{
|
||||
_strip.Warn(Game.Name, result.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
// SessionDeletion has let go of File ▸ Export's selection and the summary windows of what is gone (ids are reused).
|
||||
_strip.Success(Game.Name, result.Message);
|
||||
await LoadAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task RemoveCoreAsync()
|
||||
{
|
||||
if (Game is null)
|
||||
@@ -731,8 +864,8 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
{
|
||||
AntiCheatExceptionResult result = _exceptions is null
|
||||
? AntiCheatExceptionResult.Of(AntiCheatExceptionOutcome.AgentUnavailable)
|
||||
: await _exceptions.GrantAsync(Game.Id, new AntiCheatExceptionFacts(Game.Name, view.Family ?? string.Empty, view.Signal ?? string.Empty,
|
||||
view.Sessions)).ConfigureAwait(true);
|
||||
: await _exceptions.GrantAsync(Game.Id, new AntiCheatExceptionFacts(Game.Name, view.Family ?? string.Empty, view.Signal ?? string.Empty))
|
||||
.ConfigureAwait(true);
|
||||
Notice(result, Game.Name);
|
||||
}
|
||||
finally
|
||||
@@ -957,8 +1090,12 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
// by default it gives way to the finding alone. The setting off keeps the card, with the finding under it.
|
||||
HookingSectionVisible = !(blocked && _hideAntiCheatHooking) || exceptionInForce;
|
||||
PresentException(exception, exceptionInForce);
|
||||
// 2026-10-03: "cannot be turned on" beside a usable "Make exception…" contradicted itself; an eligible game's card
|
||||
// says what would turn it on.
|
||||
AntiCheatText = found is not null && !HookingSectionVisible
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_AntiCheat_Format, found)
|
||||
? string.Format(CultureInfo.CurrentCulture,
|
||||
_exceptionsOn && exception is { Kind: ExceptionViewKind.Eligible } ? Strings.GameDetail_AntiCheat_Exceptionable_Format : Strings.GameDetail_AntiCheat_Format,
|
||||
found)
|
||||
: null;
|
||||
// Its "Turn hooking back on" could only be refused once anti-cheat was found, or for an executable that cannot run
|
||||
// as x64, so neither row offers it.
|
||||
|
||||
@@ -1,19 +1,39 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using FrameLedger.App.Pages;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Application.Settings;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>The Games grid (<c>08_UI</c> §Games): every game in the library as a card, searched and sorted in memory; add by pick or drop; open by click.</summary>
|
||||
/// <summary>
|
||||
/// The Games library (<c>08_UI</c> §Games): every game in the library, searched and sorted in memory; add by pick or drop;
|
||||
/// open by click. Since beta.11 (owner requests 2026-10-03): shown as a grid of cards that fills the width or as a list
|
||||
/// (<c>ui.library_view</c>), with the count in the header; <b>Refresh</b> reloads the library, looks in the stores for games
|
||||
/// installed since and offers only those, and marks entries whose executable is gone ("Not installed"); and the page
|
||||
/// reloads by itself when a session ends or an import adds games while it is on screen.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public sealed partial class GamesViewModel : ObservableObject
|
||||
{
|
||||
private const string _listValue = "list";
|
||||
private const string _gridValue = "grid";
|
||||
|
||||
private readonly GameLibrary _library;
|
||||
private readonly GameSelection _selection;
|
||||
private readonly IPageNavigator _navigator;
|
||||
private readonly AddGameFlow _addGame;
|
||||
private readonly ImportLibraryFlow? _import;
|
||||
private readonly RegisteredSettings? _settings;
|
||||
private readonly IAgentLink? _agent;
|
||||
private readonly LibraryChanges? _changes;
|
||||
private readonly UiThread _ui = new();
|
||||
private IReadOnlyList<GameCardViewModel> _all = [];
|
||||
private bool _viewRead;
|
||||
private bool _attached;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _search = string.Empty;
|
||||
@@ -27,17 +47,27 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private bool _noMatch;
|
||||
|
||||
public GamesViewModel(GameLibrary library, GameSelection selection, IPageNavigator navigator, AddGameFlow addGame)
|
||||
[ObservableProperty]
|
||||
private string _headerText = Strings.Games_Header;
|
||||
|
||||
/// <summary>The list instead of the grid (<c>ui.library_view</c>); remembered when the user changes it.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _listView;
|
||||
|
||||
public GamesViewModel(GameLibrary library, GameSelection selection, IPageNavigator navigator, AddGameFlow addGame, ImportLibraryFlow? import = null,
|
||||
RegisteredSettings? settings = null, IAgentLink? agent = null, LibraryChanges? changes = null)
|
||||
{
|
||||
_library = library ?? throw new ArgumentNullException(nameof(library));
|
||||
_selection = selection ?? throw new ArgumentNullException(nameof(selection));
|
||||
_navigator = navigator ?? throw new ArgumentNullException(nameof(navigator));
|
||||
_addGame = addGame ?? throw new ArgumentNullException(nameof(addGame));
|
||||
_import = import;
|
||||
_settings = settings;
|
||||
_agent = agent;
|
||||
_changes = changes;
|
||||
Pending = LoadAsync();
|
||||
}
|
||||
|
||||
public static string Header => Strings.Games_Header;
|
||||
|
||||
public static string EmptyText => Strings.Games_Empty;
|
||||
|
||||
public static string NoMatchText => Strings.Games_NoMatch;
|
||||
@@ -48,6 +78,14 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
public static string SortLabel => Strings.Games_Sort_Label;
|
||||
|
||||
public static string RefreshText => Strings.Games_Refresh;
|
||||
|
||||
public static string RefreshToolTip => Strings.Games_Refresh_ToolTip;
|
||||
|
||||
public static string GridText => Strings.Games_View_Grid;
|
||||
|
||||
public static string ListText => Strings.Games_View_List;
|
||||
|
||||
public static IReadOnlyList<Choice<GamesSort>> Sorts { get; } =
|
||||
[
|
||||
new(GamesSort.Name, Strings.Games_Sort_Name),
|
||||
@@ -62,11 +100,85 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
public async Task LoadAsync(CancellationToken ct = default)
|
||||
{
|
||||
await ReadViewAsync(ct).ConfigureAwait(true);
|
||||
IReadOnlyList<GameCard> cards = await _library.ListCardsAsync(ct).ConfigureAwait(true);
|
||||
_all = [.. cards.Select(static c => new GameCardViewModel(c))];
|
||||
// Whether each executable is on disk is a file-system question per entry — a drive that is gone can take a moment
|
||||
// to say so — so it is asked off the UI thread, the game page's own way (GameLibrary.ExecutableExists).
|
||||
bool[] installed = await Task.Run(() => cards.Select(static c => GameLibrary.ExecutableExists(c.Row.Fingerprint.ExePath)).ToArray(), ct)
|
||||
.ConfigureAwait(true);
|
||||
_all = [.. cards.Select((c, i) => new GameCardViewModel(c, installed[i]))];
|
||||
HeaderText = string.Format(CultureInfo.CurrentCulture, Strings.Games_Header_Count_Format, _all.Count);
|
||||
Apply();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Listens while the page is on screen: a session that ends changes a card's count, playtime and last played, and an
|
||||
/// import made from the menu adds cards. The page calls it on Loaded and <see cref="Detach"/> on Unloaded; the link and
|
||||
/// the notifier are singletons and must not hold the page.
|
||||
/// </summary>
|
||||
public void Attach()
|
||||
{
|
||||
if (_attached)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_agent is not null)
|
||||
{
|
||||
_agent.EventReceived += OnAgentEvent;
|
||||
}
|
||||
|
||||
if (_changes is not null)
|
||||
{
|
||||
_changes.Changed += OnLibraryChanged;
|
||||
}
|
||||
|
||||
_attached = true;
|
||||
}
|
||||
|
||||
public void Detach()
|
||||
{
|
||||
if (!_attached)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_agent is not null)
|
||||
{
|
||||
_agent.EventReceived -= OnAgentEvent;
|
||||
}
|
||||
|
||||
if (_changes is not null)
|
||||
{
|
||||
_changes.Changed -= OnLibraryChanged;
|
||||
}
|
||||
|
||||
_attached = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: the library read again, then the stores asked for games installed since — offered in the import checklist,
|
||||
/// the games already in the library hidden — and read again when any was added. A game whose executable is gone is
|
||||
/// marked on its card by the read; nothing is removed.
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task RefreshAsync()
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
await Pending.ConfigureAwait(true);
|
||||
if (_import is not null && await _import.RunAsync(onlyNew: true).ConfigureAwait(true) is { Added: > 0 })
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
await Pending.ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void ShowGrid() => ListView = false;
|
||||
|
||||
[RelayCommand]
|
||||
private void ShowList() => ListView = true;
|
||||
|
||||
[RelayCommand]
|
||||
private async Task AddGameAsync() => _ = await _addGame.RunAsync().ConfigureAwait(true);
|
||||
|
||||
@@ -96,6 +208,43 @@ public sealed partial class GamesViewModel : ObservableObject
|
||||
|
||||
partial void OnSortChanged(GamesSort value) => Apply();
|
||||
|
||||
partial void OnListViewChanged(bool value)
|
||||
{
|
||||
if (_viewRead && _settings is not null)
|
||||
{
|
||||
_ = SaveViewAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveViewAsync(bool list) =>
|
||||
await _settings!.SetAsync(SettingsRegistry.UiLibraryView, list ? _listValue : _gridValue).ConfigureAwait(true);
|
||||
|
||||
/// <summary>The remembered view, read once per page before the first list — so reading it is not taken for a change.</summary>
|
||||
private async Task ReadViewAsync(CancellationToken ct)
|
||||
{
|
||||
if (_viewRead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_settings is not null)
|
||||
{
|
||||
ListView = string.Equals(await _settings.GetAsync(SettingsRegistry.UiLibraryView, ct).ConfigureAwait(true), _listValue, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
_viewRead = true;
|
||||
}
|
||||
|
||||
private void OnAgentEvent(object? sender, AgentEventArgs e) => _ui.Post(() =>
|
||||
{
|
||||
if (string.Equals(e.Envelope.Type, IpcMessageType.SessionCompleted, StringComparison.Ordinal))
|
||||
{
|
||||
Pending = LoadAsync();
|
||||
}
|
||||
});
|
||||
|
||||
private void OnLibraryChanged(object? sender, EventArgs e) => _ui.Post(() => Pending = LoadAsync());
|
||||
|
||||
private void Apply()
|
||||
{
|
||||
IEnumerable<GameCardViewModel> shown = _all;
|
||||
|
||||
@@ -25,6 +25,12 @@ public sealed partial class ImportCandidateViewModel : ObservableObject
|
||||
|
||||
public bool CanImport => Candidate.CanImport;
|
||||
|
||||
/// <summary>
|
||||
/// Already in the library — at this path, or (since 2026-09-23) the same file under another drive letter. Since beta.11
|
||||
/// such a row is hidden unless the user asks to see it, and then shown dimmed with a box that cannot be ticked.
|
||||
/// </summary>
|
||||
public bool IsExisting => Candidate.AlreadyInLibrary || Candidate.MovedFrom is not null;
|
||||
|
||||
public string PlatformText => Formats.Platform(Candidate.Game.Platform);
|
||||
|
||||
public string Name => Candidate.Game.Name;
|
||||
|
||||
@@ -8,7 +8,12 @@ using FrameLedger.Application.Import;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>FR-1.2's review checklist: every candidate the stores found, ticked by default where it can be imported; the count follows the ticks.</summary>
|
||||
/// <summary>
|
||||
/// FR-1.2's review checklist: every candidate the stores found, ticked by default where it can be imported; the count
|
||||
/// follows the ticks. Since beta.11 (owner request 2026-10-03) the games already in the library are hidden by default —
|
||||
/// on a re-import they were most of the list and pushed the new ones out of sight — and <see cref="ShowExisting"/> brings
|
||||
/// them back, dimmed, their boxes disabled.
|
||||
/// </summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime; a cached CompositeFormat would pin the first culture")]
|
||||
public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
{
|
||||
@@ -17,6 +22,9 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
[NotifyPropertyChangedFor(nameof(SelectedText))]
|
||||
private int _selectedCount;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _showExisting;
|
||||
|
||||
public ImportReviewViewModel(IReadOnlyList<ImportCandidate> candidates)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(candidates);
|
||||
@@ -27,11 +35,25 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
Rows.Add(row);
|
||||
}
|
||||
|
||||
ExistingCount = Rows.Count(static r => r.IsExisting);
|
||||
ShowExistingText = string.Format(CultureInfo.CurrentCulture, Strings.Import_ShowExisting_Format, ExistingCount);
|
||||
Refilter();
|
||||
Recount();
|
||||
}
|
||||
|
||||
/// <summary>Every candidate, shown or not.</summary>
|
||||
public ObservableCollection<ImportCandidateViewModel> Rows { get; } = [];
|
||||
|
||||
/// <summary>What the checklist shows: every row, less those already in the library unless <see cref="ShowExisting"/>.</summary>
|
||||
public ObservableCollection<ImportCandidateViewModel> Shown { get; } = [];
|
||||
|
||||
/// <summary>Rows already in the library (at this path or another drive letter).</summary>
|
||||
public int ExistingCount { get; }
|
||||
|
||||
public bool HasExisting => ExistingCount > 0;
|
||||
|
||||
public string ShowExistingText { get; }
|
||||
|
||||
public static string Title => Strings.Import_Title;
|
||||
|
||||
public static string Intro => Strings.Import_Intro;
|
||||
@@ -77,4 +99,15 @@ public sealed partial class ImportReviewViewModel : ObservableObject
|
||||
}
|
||||
|
||||
private void Recount() => SelectedCount = Rows.Count(static r => r.IsSelected && r.CanImport);
|
||||
|
||||
partial void OnShowExistingChanged(bool value) => Refilter();
|
||||
|
||||
private void Refilter()
|
||||
{
|
||||
Shown.Clear();
|
||||
foreach (ImportCandidateViewModel r in Rows.Where(r => ShowExisting || !r.IsExisting))
|
||||
{
|
||||
Shown.Add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
private readonly IAgentLink _agent;
|
||||
private readonly IRunAtLogon _runAtLogon;
|
||||
private readonly IMessageStrip _strip;
|
||||
private readonly IConfirmations? _confirmations;
|
||||
private readonly SessionDeletion? _deletion;
|
||||
private long _sessionTotal;
|
||||
private readonly IMaintenanceState _maintenance;
|
||||
private readonly IAgentTool _tool;
|
||||
private readonly WindowClosePolicy _closePolicy;
|
||||
@@ -147,8 +150,14 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
IFirstRunFlow firstRun,
|
||||
AntiCheatExceptions? exceptions = null,
|
||||
IAgentAdminPrompt? adminPrompt = null,
|
||||
Func<bool>? agentHeld = null)
|
||||
Func<bool>? agentHeld = null,
|
||||
IConfirmations? confirmations = null,
|
||||
SessionDeletion? deletion = null)
|
||||
{
|
||||
// beta.11 (D40): Settings ▸ Data's Delete all sessions — its confirmation and its request; a composition without them
|
||||
// (a test) deletes nothing.
|
||||
_confirmations = confirmations;
|
||||
_deletion = deletion;
|
||||
// The admin mode's disclosure (a composition without it — a test — cannot turn the mode on), and the probe of the
|
||||
// data folder's instance lock the restart waits on (a test's own).
|
||||
_adminPrompt = adminPrompt;
|
||||
@@ -181,7 +190,6 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
|
||||
public static string LanguageLabel => Strings.Settings_Language_Label;
|
||||
|
||||
public static string LanguageNote => Strings.Settings_Language_Note;
|
||||
|
||||
public static IReadOnlyList<Choice<AppTheme>> Themes { get; } =
|
||||
[
|
||||
@@ -215,6 +223,9 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
|
||||
public ObservableCollection<HookedGameViewModel> HookedGames { get; } = [];
|
||||
|
||||
/// <summary>beta.11: the "Games with hooking on" card is shown only while it lists a game (a row with no control is not shown).</summary>
|
||||
public bool HasHookedGames => HookedGames.Count > 0;
|
||||
|
||||
/// <summary>
|
||||
/// D33: the games the user-mode exception concerns — in force, eligible, or held back only by the session count. The rest
|
||||
/// of the blocked games say why not on their own pages.
|
||||
@@ -513,6 +524,8 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
}
|
||||
|
||||
PresentExceptions(cards);
|
||||
OnPropertyChanged(nameof(HasHookedGames));
|
||||
_sessionTotal = cards.Sum(static c => c.Summary?.SessionCount ?? 0);
|
||||
|
||||
Shared.Ipc.HelloAck? hello = _agent.Hello;
|
||||
ElevationText = ElevationTextOf(_agent.State, hello);
|
||||
@@ -570,9 +583,11 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
}
|
||||
|
||||
checking |= view.Kind == ExceptionViewKind.Checking;
|
||||
// With the option off only a kept grant is listed (suspended): nothing may be made while it is off.
|
||||
// With the option off only a kept grant is listed (suspended): nothing may be made while it is off. On, a row is
|
||||
// listed only when it has an action — make or withdraw (2026-10-03: a game that can never qualify was listed with
|
||||
// none, and its page says why).
|
||||
bool listed = UserModeExceptions
|
||||
? view.Kind is ExceptionViewKind.Granted or ExceptionViewKind.Eligible or ExceptionViewKind.TooFewSessions
|
||||
? view.Kind is ExceptionViewKind.Granted or ExceptionViewKind.Eligible
|
||||
: view.Kind == ExceptionViewKind.Granted;
|
||||
if (listed)
|
||||
{
|
||||
@@ -590,7 +605,7 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
AntiCheatExceptionResult result = _exceptions is null
|
||||
? AntiCheatExceptionResult.Of(AntiCheatExceptionOutcome.AgentUnavailable)
|
||||
: await _exceptions.GrantAsync(game.GameId, new AntiCheatExceptionFacts(game.Name, game.View.Family ?? string.Empty,
|
||||
game.View.Signal ?? string.Empty, game.View.Sessions)).ConfigureAwait(true);
|
||||
game.View.Signal ?? string.Empty)).ConfigureAwait(true);
|
||||
await ReportExceptionAsync(game.Name, result).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
@@ -622,6 +637,33 @@ public sealed partial class SettingsViewModel : ObservableObject
|
||||
[RelayCommand]
|
||||
private Task RefreshExceptionsAsync() => RefreshAsync();
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): every session of every game, after the confirmation, through the Agent; the library, the settings and
|
||||
/// every consent stay.
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task DeleteAllSessionsAsync()
|
||||
{
|
||||
if (_confirmations is null || !await _confirmations.DeleteSessionsAsync(null, _sessionTotal).ConfigureAwait(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SessionDeletionResult result = _deletion is null
|
||||
? new(SessionDeletionOutcome.AgentUnavailable)
|
||||
: await _deletion.DeleteAsync(null).ConfigureAwait(true);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
_strip.Success(Strings.Settings_DeleteSessions_Label, result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
_strip.Warn(Strings.Settings_DeleteSessions_Label, result.Message);
|
||||
}
|
||||
|
||||
await RefreshCoreAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task RevokeAsync(HookedGameViewModel game)
|
||||
{
|
||||
HookingConsentResult result = await _consent.DisableAsync(game.GameId).ConfigureAwait(true);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using FrameLedger.App.Charts;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One metric the Trend can draw beside the selected one (beta.11, owner decision D39: several metrics at once). Disabled
|
||||
/// when it is the selected metric itself, or when two units are already on the chart and it is in neither.
|
||||
/// </summary>
|
||||
public sealed partial class TrendMetricOptionViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool _isSelected;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isEnabled = true;
|
||||
|
||||
public TrendMetricOptionViewModel(TrendMetric metric, string label, string unit)
|
||||
{
|
||||
Metric = metric;
|
||||
Label = label ?? throw new ArgumentNullException(nameof(label));
|
||||
Unit = unit ?? throw new ArgumentNullException(nameof(unit));
|
||||
}
|
||||
|
||||
public TrendMetric Metric { get; }
|
||||
|
||||
public string Label { get; }
|
||||
|
||||
/// <summary>The axis it is drawn against (<see cref="TrendSeriesBuilder.UnitOf"/>).</summary>
|
||||
public string Unit { get; }
|
||||
}
|
||||
@@ -169,18 +169,23 @@ public sealed class AntiCheatPreScanSweep : IDisposable
|
||||
/// <summary>
|
||||
/// D33: the exception question about one BLOCKED entry. A grant made on bytes that are no longer on disk ends whether
|
||||
/// or not the option is on; the rest runs only while it is — a tolerant pre-scan naming the block's family when the
|
||||
/// rules, the executable or the block changed since the last one, and the session count every pass — and ends a grant
|
||||
/// the facts no longer support. A scan that could not answer ends nothing: the session start runs the full check anyway.
|
||||
/// rules, the executable or the block changed since the last one, and (D38) the trial's progress under the grant in
|
||||
/// force every pass — and ends a grant the facts no longer support. A scan that could not answer ends nothing: the
|
||||
/// session start runs the full check anyway.
|
||||
/// </summary>
|
||||
private async ValueTask<AntiCheatPreScanReport> ExceptionPassAsync(GameRow game, string rulesVersion, AntiCheatPreScanReport report,
|
||||
CancellationToken ct)
|
||||
{
|
||||
if (_sessions is null || game.HookBlockedReason is not { Length: > 0 } block || _isRecording(game.Id)
|
||||
|| _identity.Read(game.Fingerprint.ExePath) is not { } onDisk)
|
||||
if (_sessions is null || game.HookBlockedReason is not { Length: > 0 } block || _isRecording(game.Id))
|
||||
{
|
||||
return report;
|
||||
}
|
||||
|
||||
if (_identity.Read(game.Fingerprint.ExePath) is not { } onDisk)
|
||||
{
|
||||
return await UnreadableAsync(game, block, rulesVersion, report, ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
AntiCheatExceptionState state = game.AcException;
|
||||
bool granted = state.IsGranted;
|
||||
if (granted && !state.GrantCovers(onDisk))
|
||||
@@ -195,7 +200,10 @@ public sealed class AntiCheatPreScanSweep : IDisposable
|
||||
}
|
||||
|
||||
StoredBlock? parsed = StoredBlock.Parse(block);
|
||||
int sessions = await _sessions.CountSuccessfulHookedAsync(game.Id, ct).ConfigureAwait(false);
|
||||
// D38: the trial's progress under the grant in force — what the App shows; eligibility no longer counts sessions.
|
||||
int sessions = granted && state.Family is { Length: > 0 } family && state.GrantedAt is { } grantedAt
|
||||
? await _sessions.CountSuccessfulUnderGrantAsync(game.Id, family, grantedAt, ct).ConfigureAwait(false)
|
||||
: 0;
|
||||
bool fresh = state.IsCheckedFor(onDisk, rulesVersion, block);
|
||||
AntiCheatVerdict? verdict = parsed is not { IsExceptionable: true } b
|
||||
? null
|
||||
@@ -203,7 +211,7 @@ public sealed class AntiCheatPreScanSweep : IDisposable
|
||||
? stored
|
||||
: await _guard.PreScanGameAsync(onDisk.ExePath, b.Family, ct).ConfigureAwait(false);
|
||||
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(parsed, v, sessions);
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(parsed, v, state.TrialFailed);
|
||||
if (!fresh || eligible != state.Eligible || sessions != state.Sessions)
|
||||
{
|
||||
if (await _consent.RecordExceptionEligibilityAsync(onDisk, block, verdict, sessions, rulesVersion, ct).ConfigureAwait(false)
|
||||
@@ -211,7 +219,9 @@ public sealed class AntiCheatPreScanSweep : IDisposable
|
||||
{
|
||||
report = report with { ExceptionsChecked = report.ExceptionsChecked + 1 };
|
||||
_log($"prescan: {game.Name} — user-mode exception {(eligible ? "eligible" : "not eligible")} "
|
||||
+ $"({(verdict is { } said ? Said(said) : "not a module, file or folder finding")}; {sessions} successful hooked sessions)");
|
||||
+ $"({(verdict is { } said ? Said(said) : "not a module, file or folder finding")}"
|
||||
+ (state.TrialFailed ? "; an earlier exception failed its trial" : string.Empty)
|
||||
+ (granted ? $"; trial {sessions} of {UserModeExceptionRules.TrialSessions}" : string.Empty) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,9 +231,40 @@ public sealed class AntiCheatPreScanSweep : IDisposable
|
||||
: report;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 2026-10-03: a blocked entry whose executable cannot be read is ANSWERED while the option is on — "the check could not
|
||||
/// run" (<c>PreScanFailed</c>, no family), keyed on no bytes so the first readable pass scans again — rather than left
|
||||
/// "checking" for ever, which is what returning early did. A grant is left alone: the session start runs the full check.
|
||||
/// </summary>
|
||||
private async ValueTask<AntiCheatPreScanReport> UnreadableAsync(GameRow game, string block, string rulesVersion, AntiCheatPreScanReport report,
|
||||
CancellationToken ct)
|
||||
{
|
||||
AntiCheatExceptionState state = game.AcException;
|
||||
if (_exceptions is null || state.IsGranted || !await _exceptions.IsOnAsync(ct).ConfigureAwait(false))
|
||||
{
|
||||
return report;
|
||||
}
|
||||
|
||||
if (string.Equals(state.CheckedBlock, block, StringComparison.Ordinal)
|
||||
&& StoredBlock.Parse(state.Verdict) is { Reason: AntiCheatRefusalReason.PreScanFailed, Family.Length: 0 })
|
||||
{
|
||||
return report; // already said, and nothing has changed that a pass could see
|
||||
}
|
||||
|
||||
var nothingRead = new ExecutableFingerprint { ExePath = game.Fingerprint.ExePath, SizeBytes = 0, MtimeUnixMs = 0 };
|
||||
AntiCheatVerdict couldNotRun = AntiCheatVerdict.Refused(AntiCheatRefusalReason.PreScanFailed, string.Empty, Path.GetFileName(game.Fingerprint.ExePath));
|
||||
if (await _consent.RecordExceptionEligibilityAsync(nothingRead, block, couldNotRun, 0, rulesVersion, ct).ConfigureAwait(false) == ConsentWriteOutcome.Written)
|
||||
{
|
||||
_log($"prescan: {game.Name} — user-mode exception not checked: the executable could not be read");
|
||||
report = report with { ExceptionsChecked = report.ExceptionsChecked + 1 };
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
private async ValueTask<AntiCheatPreScanReport> EndAsync(GameRow game, string lapse, string why, AntiCheatPreScanReport report, CancellationToken ct)
|
||||
{
|
||||
if (await _consent.RevokeAntiCheatExceptionAsync(game.Fingerprint.ExePath, lapse, ct).ConfigureAwait(false) != ConsentWriteOutcome.Written)
|
||||
if (await _consent.RevokeAntiCheatExceptionAsync(game.Fingerprint.ExePath, lapse, ct: ct).ConfigureAwait(false) != ConsentWriteOutcome.Written)
|
||||
{
|
||||
return report;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public static class UserModeExceptionLapse
|
||||
/// <summary>The executable is not the one the grant was made on: a game update, or <i>Change executable</i>.</summary>
|
||||
public const string ExecutableChanged = "ExecutableChanged";
|
||||
|
||||
/// <summary>The guard no longer lets the game through under it: a new finding, a <c>.sys</c>, the family turned kernel-level, too few sessions.</summary>
|
||||
/// <summary>The guard no longer lets the game through under it: a new finding, a <c>.sys</c>, the family turned kernel-level.</summary>
|
||||
public const string NoLongerEligible = "NoLongerEligible";
|
||||
|
||||
/// <summary>A finding about the game at a session's start, at the 30 s re-scan or when hooking was turned on.</summary>
|
||||
@@ -26,4 +26,11 @@ public static class UserModeExceptionLapse
|
||||
|
||||
/// <summary>A session under it ended in a crash.</summary>
|
||||
public const string SessionCrashed = "SessionCrashed";
|
||||
|
||||
/// <summary>
|
||||
/// D38: a session in its trial did not succeed — hooked and stored, but it recorded no frame or did not end normally —
|
||||
/// and nothing more specific said why. Any end during the trial, this one or another, also marks the game so that no
|
||||
/// exception can be made for it again (<c>games.ac_exception_trial_failed_at</c>).
|
||||
/// </summary>
|
||||
public const string TrialFailed = "TrialFailed";
|
||||
}
|
||||
@@ -4,10 +4,10 @@ using FrameLedger.Domain.Consent;
|
||||
namespace FrameLedger.Application.AntiCheat;
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): the managed rules of the user-mode exception — what a grant needs before the guard is
|
||||
/// even asked to tolerate a family, and the words its end is recorded in. The guard's own rules (which family is user-mode,
|
||||
/// what is never excepted, scanning past what it lets through) are native and are not repeated here
|
||||
/// (<c>19_SAFETY</c> §The user-mode exception).
|
||||
/// D33 (owner decision 2026-09-26) as amended by D38 (2026-10-03): the managed rules of the user-mode exception — what a
|
||||
/// grant needs before the guard is even asked to tolerate a family, and how long its trial lasts. The guard's own rules
|
||||
/// (which family is user-mode, what is never excepted, scanning past what it lets through) are native and are not repeated
|
||||
/// here (<c>19_SAFETY</c> §The user-mode exception).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
@@ -16,16 +16,27 @@ namespace FrameLedger.Application.AntiCheat;
|
||||
/// user-mode, and it refuses on anything else it finds. There is no path from this class to an injection that the
|
||||
/// guard did not pass.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>D38: the evidence comes after the grant, not before it.</b> D33 asked for two successful Tier-1 sessions before a
|
||||
/// grant; since beta.8's library sweep blocks a game the moment it is added, a blocked game could never be hooked to earn
|
||||
/// them, and a reset ledger lost them — the exception was unreachable for every game blocked from the start. A grant now
|
||||
/// needs no session; its first <see cref="TrialSessions"/> hooked sessions are a trial, and one of them ending badly ends
|
||||
/// the exception for good (<c>games.ac_exception_trial_failed_at</c>, which nothing clears).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class UserModeExceptionRules
|
||||
{
|
||||
/// <summary>The owner's threshold: successful Tier-1 sessions of the game before its exception may be granted.</summary>
|
||||
/// <summary>
|
||||
/// The owner's trial (D38): the hooked sessions under a grant that must each succeed before the exception is past its
|
||||
/// trial. Until then any session under it that does not succeed ends it and marks the game so that no exception can
|
||||
/// be made for it again.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// "Successful" is <c>ISessionRepository.CountSuccessfulHookedAsync</c>'s: hooked, frames recorded, <c>exit_status =
|
||||
/// "Succeed" is <c>ISessionRepository.CountSuccessfulUnderGrantAsync</c>'s: hooked, frames recorded, <c>exit_status =
|
||||
/// normal</c> — which since beta.8 includes End task's exit code 1 and a user's stop, and never a crash, a safety
|
||||
/// unhook, a degraded or an interrupted session.
|
||||
/// </remarks>
|
||||
public const int RequiredSessions = 2;
|
||||
public const int TrialSessions = 2;
|
||||
|
||||
/// <summary>
|
||||
/// The family the game's exception covers for a session against <paramref name="observed"/>, or null: the option is
|
||||
@@ -50,12 +61,18 @@ public static class UserModeExceptionRules
|
||||
|
||||
/// <summary>
|
||||
/// Whether <paramref name="verdict"/> — a tolerant pre-scan asked about <paramref name="block"/>'s family — makes the
|
||||
/// game eligible, given <paramref name="sessions"/> successful Tier-1 sessions: the guard passed and named that same
|
||||
/// family as what it let through, and the evidence reaches <see cref="RequiredSessions"/>.
|
||||
/// game eligible: the guard passed and named that same family as what it let through, and no earlier exception of the
|
||||
/// game failed its trial (<paramref name="trialFailed"/>, D38).
|
||||
/// </summary>
|
||||
public static bool IsEligible(StoredBlock? block, AntiCheatVerdict verdict, int sessions) =>
|
||||
block is { IsExceptionable: true } b
|
||||
public static bool IsEligible(StoredBlock? block, AntiCheatVerdict verdict, bool trialFailed) =>
|
||||
!trialFailed
|
||||
&& block is { IsExceptionable: true } b
|
||||
&& verdict.RanUnderException
|
||||
&& string.Equals(verdict.Family, b.Family, StringComparison.Ordinal)
|
||||
&& sessions >= RequiredSessions;
|
||||
&& string.Equals(verdict.Family, b.Family, StringComparison.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// Whether a grant with <paramref name="successfulBefore"/> successful sessions under it — not counting the session
|
||||
/// being judged — is still in its trial (D38).
|
||||
/// </summary>
|
||||
public static bool InTrial(int successfulBefore) => successfulBefore < TrialSessions;
|
||||
}
|
||||
@@ -18,9 +18,6 @@ public sealed record AntiCheatExceptionGrantRequest
|
||||
/// <summary>The guard's tolerant pre-scan, asked about the block's family just now.</summary>
|
||||
public required AntiCheatVerdict Verdict { get; init; }
|
||||
|
||||
/// <summary>Successful Tier-1 sessions of the game, counted just now.</summary>
|
||||
public required int Sessions { get; init; }
|
||||
|
||||
/// <summary>The disclosure the user accepted — the Agent's own version, checked before this request exists.</summary>
|
||||
public required string DisclosureVersion { get; init; }
|
||||
|
||||
|
||||
@@ -138,8 +138,10 @@ public interface IGameConsentStore
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): the sweep's answer about one BLOCKED game — whether its user-mode exception may be
|
||||
/// granted — from the facts it gathered: <paramref name="verdict"/>, a tolerant pre-scan asked about the block's family
|
||||
/// (null when the block is not of a kind worth asking about), and <paramref name="sessions"/> successful Tier-1 sessions.
|
||||
/// The rule is <c>UserModeExceptionRules.IsEligible</c>, applied here so the row cannot say "eligible" over facts that are not.
|
||||
/// (null when the block is not of a kind worth asking about). The rule is <c>UserModeExceptionRules.IsEligible</c>,
|
||||
/// applied here so the row cannot say "eligible" over facts that are not — and since D38 (2026-10-03) a row whose
|
||||
/// exception once failed its trial is never written eligible, in SQL. <paramref name="sessions"/> is the trial's progress
|
||||
/// under the grant in force (0 with none), stored for the App to show.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Written with the key it was reached under — <paramref name="rulesVersion"/>, the executable's size and mtime in
|
||||
@@ -151,12 +153,13 @@ public interface IGameConsentStore
|
||||
ExecutableFingerprint scanned, string block, AntiCheatVerdict? verdict, int sessions, string rulesVersion, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// D33: grant a game's user-mode exception, on facts gathered just now — the tolerant pre-scan and the session count in
|
||||
/// <paramref name="grant"/> — after the user accepted its disclosure.
|
||||
/// D33: grant a game's user-mode exception, on facts gathered just now — the tolerant pre-scan in
|
||||
/// <paramref name="grant"/> — after the user accepted its disclosure. D38: the grant starts its trial at zero sessions.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <see cref="ConsentWriteOutcome.NotEligible"/> and nothing written unless <c>UserModeExceptionRules.IsEligible</c> holds for
|
||||
/// those facts; <see cref="ConsentWriteOutcome.NotFound"/> when the row no longer carries the block the facts are about.
|
||||
/// those facts and no exception of the game failed its trial (read from the row in the same transaction);
|
||||
/// <see cref="ConsentWriteOutcome.NotFound"/> when the row no longer carries the block the facts are about.
|
||||
/// It never clears the block, never enables hooking and never stamps consent: turning hooking on is FR-2.1's own
|
||||
/// dialog, afterwards.
|
||||
/// </remarks>
|
||||
@@ -165,8 +168,11 @@ public interface IGameConsentStore
|
||||
/// <summary>
|
||||
/// D33: end a game's user-mode exception, for <paramref name="reason"/> (<c>UserModeExceptionLapse</c>), and turn its
|
||||
/// hooking off while the block stands. The consent stamp is preserved, as a block preserves it; the family, the
|
||||
/// disclosure and the executable the grant was made on stay on the row as history.
|
||||
/// disclosure and the executable the grant was made on stay on the row as history. D38: <paramref name="trialFailed"/>
|
||||
/// — the end came during the grant's trial — also marks the game (<c>ac_exception_trial_failed_at</c>), and no exception
|
||||
/// can be made for it again.
|
||||
/// </summary>
|
||||
/// <remarks><see cref="ConsentWriteOutcome.NotFound"/> when there was no exception in force.</remarks>
|
||||
ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, CancellationToken ct = default);
|
||||
ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, bool trialFailed = false,
|
||||
CancellationToken ct = default);
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public sealed class AgentCommandHandler
|
||||
private readonly TimeProvider _clock;
|
||||
private readonly VkLayerReconciler? _layer;
|
||||
private readonly Func<CancellationToken, ValueTask<SweepRetentionAck>>? _sweepRetention;
|
||||
private readonly ISessionRepository? _deleteSessions;
|
||||
private readonly ExecutableRelocator? _relocator;
|
||||
private readonly IExecutableArchitectureSource? _architecture;
|
||||
private readonly AntiCheatExceptionCommands? _exceptions;
|
||||
@@ -53,8 +54,12 @@ public sealed class AgentCommandHandler
|
||||
/// </summary>
|
||||
public const string BlockNotExceptionableReason = "BlockNotExceptionable";
|
||||
|
||||
/// <summary>D33: <c>Refused.reason</c> for an exception asked with fewer successful hooked sessions than the owner's threshold; <c>signal</c> carries the count.</summary>
|
||||
public const string TooFewSessionsReason = "TooFewSessions";
|
||||
/// <summary>
|
||||
/// D38 (owner decision 2026-10-03): <c>Refused.reason</c> for an exception asked for a game an earlier exception of which
|
||||
/// ended during its trial — for good; <c>signal</c> carries when (unix ms). (D33's <c>TooFewSessions</c> is gone with the
|
||||
/// session threshold it named.)
|
||||
/// </summary>
|
||||
public const string TrialFailedReason = "TrialFailed";
|
||||
|
||||
/// <summary>
|
||||
/// <c>disclosureVersion</c> is the version of FR-2.1's reviewed disclosure this Agent carries
|
||||
@@ -65,8 +70,10 @@ public sealed class AgentCommandHandler
|
||||
CaptureOrchestrator orchestrator, CapturePause pause, IAgentLifetime lifetime, Func<CancellationToken, ValueTask<string>> updateRules,
|
||||
string? disclosureVersion = null, TimeProvider? clock = null, VkLayerReconciler? layer = null,
|
||||
Func<CancellationToken, ValueTask<SweepRetentionAck>>? sweepRetention = null, ExecutableRelocator? relocator = null,
|
||||
IExecutableArchitectureSource? architecture = null, AntiCheatExceptionCommands? exceptions = null)
|
||||
IExecutableArchitectureSource? architecture = null, AntiCheatExceptionCommands? exceptions = null, ISessionRepository? deleteSessions = null)
|
||||
{
|
||||
// beta.11 (D40): DeleteSessions — composed under --serve over the Agent's own repository; absent, not answered (UnknownType).
|
||||
_deleteSessions = deleteSessions;
|
||||
// D33: the user-mode exception's collaborators — its option, its evidence, its disclosure version. Absent, no
|
||||
// exception applies to SetHookEnabled and SetAntiCheatException is not answered (UnknownType).
|
||||
_exceptions = exceptions;
|
||||
@@ -113,10 +120,34 @@ public sealed class AgentCommandHandler
|
||||
IpcMessageType.SetAntiCheatException when _exceptions is not null => await SetAntiCheatExceptionAsync(request, _exceptions, ct).ConfigureAwait(false),
|
||||
IpcMessageType.SweepRetention when _sweepRetention is not null =>
|
||||
IpcCodec.Encode(IpcMessageType.SweepRetentionAck, request.Id, await _sweepRetention(ct).ConfigureAwait(false)),
|
||||
IpcMessageType.DeleteSessions when _deleteSessions is not null => await DeleteSessionsAsync(request, _deleteSessions, ct).ConfigureAwait(false),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): every session of one game, or of every game — never while a session it would delete
|
||||
/// under is being recorded (that session would land after the delete, and a summary the App opened could point at a
|
||||
/// reused id). The rows are the Agent's (<c>06_DATA_MODEL</c> §Writer ownership), so the Agent deletes them.
|
||||
/// </summary>
|
||||
private async ValueTask<byte[]> DeleteSessionsAsync(IpcEnvelope request, ISessionRepository sessions, CancellationToken ct)
|
||||
{
|
||||
DeleteSessionsRequest? payload = IpcCodec.Payload<DeleteSessionsRequest>(request);
|
||||
if (payload is null)
|
||||
{
|
||||
return Malformed(request, "DeleteSessions carries no payload");
|
||||
}
|
||||
|
||||
bool running = payload.GameId is { } one ? _orchestrator.IsRecording(one) : _orchestrator.IsRecordingAny();
|
||||
if (running)
|
||||
{
|
||||
return Error(request, IpcErrorCode.SessionRunning, "a session is being recorded; nothing was deleted — stop it or let it end, then try again");
|
||||
}
|
||||
|
||||
RetentionSweepResult deleted = await sessions.DeleteSessionsAsync(payload.GameId, ct).ConfigureAwait(false);
|
||||
return IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, request.Id, new DeleteSessionsAck(payload.GameId, deleted.Games, deleted.Sessions));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identity only (<c>07_IPC</c>: "carries no hooking state"): every entry's row is ensured, hooking off when new.
|
||||
/// Nothing is removed — removing a game is the App's FR-1.4 (with its "keep the sessions?" question), never a
|
||||
@@ -231,7 +262,7 @@ public sealed class AgentCommandHandler
|
||||
await _consent.RecordGuardBlockAsync(fingerprint, verdict, ct).ConfigureAwait(false);
|
||||
if (tolerated is not null && verdict.IsFindingAboutTheGame)
|
||||
{
|
||||
await _consent.RevokeAntiCheatExceptionAsync(fingerprint.ExePath, UserModeExceptionLapse.NewFinding, ct).ConfigureAwait(false);
|
||||
await _consent.RevokeAntiCheatExceptionAsync(fingerprint.ExePath, UserModeExceptionLapse.NewFinding, ct: ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await ReconcileLayerAsync(ct).ConfigureAwait(false);
|
||||
@@ -277,7 +308,7 @@ public sealed class AgentCommandHandler
|
||||
|
||||
if (!payload.Enabled)
|
||||
{
|
||||
ConsentWriteOutcome withdrawn = await _consent.RevokeAntiCheatExceptionAsync(game.Fingerprint.ExePath, UserModeExceptionLapse.Withdrawn, ct)
|
||||
ConsentWriteOutcome withdrawn = await _consent.RevokeAntiCheatExceptionAsync(game.Fingerprint.ExePath, UserModeExceptionLapse.Withdrawn, ct: ct)
|
||||
.ConfigureAwait(false);
|
||||
await ReconcileLayerAsync(ct).ConfigureAwait(false);
|
||||
return IpcCodec.Encode(IpcMessageType.AntiCheatExceptionAck, request.Id,
|
||||
@@ -297,8 +328,9 @@ public sealed class AgentCommandHandler
|
||||
|
||||
/// <summary>
|
||||
/// D33: the facts a grant rests on, gathered here and now — the block on the row, a tolerant pre-scan of the executable on
|
||||
/// disk naming the block's family, and the successful Tier-1 sessions — each refusal said as what it is; the store then
|
||||
/// writes the grant only when they make the game eligible, and only while the row still carries that block.
|
||||
/// disk naming the block's family — each refusal said as what it is; the store then writes the grant only when they make
|
||||
/// the game eligible, and only while the row still carries that block. D38: no session is needed any more — the grant's
|
||||
/// first sessions are its trial — and a game whose exception once failed its trial is refused before anything is scanned.
|
||||
/// </summary>
|
||||
private async ValueTask<byte[]> GrantExceptionAsync(IpcEnvelope request, GameRow game, AntiCheatExceptionCommands exceptions, CancellationToken ct)
|
||||
{
|
||||
@@ -308,6 +340,12 @@ public sealed class AgentCommandHandler
|
||||
return IpcCodec.Encode(IpcMessageType.Refused, request.Id, new RefusedAck(game.Id, BlockNotExceptionableReason, Family: null, Signal: null));
|
||||
}
|
||||
|
||||
if (game.AcException.TrialFailedAt is { } failedAt)
|
||||
{
|
||||
return IpcCodec.Encode(IpcMessageType.Refused, request.Id, new RefusedAck(game.Id, TrialFailedReason, block.Family,
|
||||
failedAt.ToUnixTimeMilliseconds().ToString(System.Globalization.CultureInfo.InvariantCulture)));
|
||||
}
|
||||
|
||||
if (_identity.Read(path) is not { } fingerprint)
|
||||
{
|
||||
return Error(request, IpcErrorCode.ExecutableUnreadable, $"{path} could not be read, so nothing can be scanned or granted");
|
||||
@@ -320,19 +358,11 @@ public sealed class AgentCommandHandler
|
||||
return IpcCodec.Encode(IpcMessageType.Refused, request.Id, new RefusedAck(game.Id, reason, NullIfEmpty(verdict.Family), NullIfEmpty(verdict.Signal)));
|
||||
}
|
||||
|
||||
int sessions = await exceptions.Sessions.CountSuccessfulHookedAsync(game.Id, ct).ConfigureAwait(false);
|
||||
if (sessions < UserModeExceptionRules.RequiredSessions)
|
||||
{
|
||||
return IpcCodec.Encode(IpcMessageType.Refused, request.Id, new RefusedAck(game.Id, TooFewSessionsReason, block.Family,
|
||||
sessions.ToString(System.Globalization.CultureInfo.InvariantCulture)));
|
||||
}
|
||||
|
||||
ConsentWriteOutcome outcome = await _consent.GrantAntiCheatExceptionAsync(new AntiCheatExceptionGrantRequest
|
||||
{
|
||||
Fingerprint = fingerprint,
|
||||
Block = game.HookBlockedReason!,
|
||||
Verdict = verdict,
|
||||
Sessions = sessions,
|
||||
DisclosureVersion = exceptions.DisclosureVersion,
|
||||
GrantedAt = _clock.GetUtcNow(),
|
||||
}, ct).ConfigureAwait(false);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Persistence;
|
||||
|
||||
namespace FrameLedger.Application.Ipc;
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): what <see cref="AgentCommandHandler"/> needs to answer for a game's user-mode exception —
|
||||
/// the option, the evidence, and the disclosure version this Agent grants against. One parameter rather than three, so a
|
||||
/// composition either has the exception or does not.
|
||||
/// the option and the disclosure version this Agent grants against. One parameter rather than two, so a composition either
|
||||
/// has the exception or does not. (D38 took the session count out: a grant needs no session any more.)
|
||||
/// </summary>
|
||||
/// <param name="Switch"><c>hooking.usermode_ac_exceptions</c>, read on every command.</param>
|
||||
/// <param name="Sessions">Where the successful Tier-1 sessions are counted.</param>
|
||||
/// <param name="DisclosureVersion"><c>Shared.Safety.AntiCheatExceptionDisclosure.Version</c> under <c>--serve</c>.</param>
|
||||
public sealed record AntiCheatExceptionCommands(IUserModeExceptionSwitch Switch, ISessionRepository Sessions, string DisclosureVersion);
|
||||
public sealed record AntiCheatExceptionCommands(IUserModeExceptionSwitch Switch, string DisclosureVersion);
|
||||
@@ -3,9 +3,10 @@ using FrameLedger.Domain.Consent;
|
||||
namespace FrameLedger.Application.Persistence;
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): <c>games.ac_exception_*</c> as read (schema 0014) — the Agent's eligibility answer
|
||||
/// about a blocked game, the user's grant of its user-mode exception, and how the last grant ended. Read-only here: every
|
||||
/// write is the consent store's (<c>IGameConsentStore</c>) or a downgrade in <c>ChangeExecutableAsync</c>.
|
||||
/// D33 (owner decision 2026-09-26): <c>games.ac_exception_*</c> as read (schema 0014, and 0017 for D38's trial) — the
|
||||
/// Agent's eligibility answer about a blocked game, the user's grant of its user-mode exception, how far its trial has come,
|
||||
/// and how the last grant ended. Read-only here: every write is the consent store's (<c>IGameConsentStore</c>) or a
|
||||
/// downgrade in <c>ChangeExecutableAsync</c>.
|
||||
/// </summary>
|
||||
public sealed record AntiCheatExceptionState
|
||||
{
|
||||
@@ -18,7 +19,11 @@ public sealed record AntiCheatExceptionState
|
||||
/// <summary>The guard's tolerant pre-scan behind <see cref="Eligible"/>, as <c>Reason|Family|Signal</c>; null when nothing was asked.</summary>
|
||||
public string? Verdict { get; init; }
|
||||
|
||||
/// <summary>Successful Tier-1 sessions of the game when the sweep last counted.</summary>
|
||||
/// <summary>
|
||||
/// D38: successful hooked sessions under the grant in force when the sweep last counted — its trial's progress against
|
||||
/// <c>UserModeExceptionRules.TrialSessions</c>; 0 with no grant. (D33 counted every successful Tier-1 session of the game
|
||||
/// here, the evidence a grant needed before D38.)
|
||||
/// </summary>
|
||||
public int Sessions { get; init; }
|
||||
|
||||
/// <summary>The rules version <see cref="Verdict"/> was reached under.</summary>
|
||||
@@ -54,6 +59,15 @@ public sealed record AntiCheatExceptionState
|
||||
/// <summary>Why the last grant ended (<c>UserModeExceptionLapse</c>).</summary>
|
||||
public string? LapsedReason { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// D38 (schema 0017): when an exception of this game ended during its trial; null when none did. Never cleared — not by
|
||||
/// a withdrawal, a game update or <i>Change executable</i> — and while it is set no exception can be made for the game.
|
||||
/// </summary>
|
||||
public DateTimeOffset? TrialFailedAt { get; init; }
|
||||
|
||||
/// <summary>D38: an exception of this game failed its trial, so none can be made again.</summary>
|
||||
public bool TrialFailed => TrialFailedAt is not null;
|
||||
|
||||
/// <summary>An exception is in force on the row (whether the option lets it apply is the capture path's question).</summary>
|
||||
public bool IsGranted => GrantedAt is not null && !string.IsNullOrEmpty(Family);
|
||||
|
||||
|
||||
@@ -40,12 +40,14 @@ public interface ISessionRepository
|
||||
ValueTask<long> CountSinceAsync(DateTimeOffset since, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): the game's successful Tier-1 sessions — hooked, frames recorded, <c>exit_status =
|
||||
/// normal</c> — the evidence a user-mode exception needs <c>UserModeExceptionRules.RequiredSessions</c> of. Since beta.8
|
||||
/// <c>normal</c> includes End task's exit code 1 and a user's stop; a crashed, unhooked-for-safety, degraded or
|
||||
/// interrupted session never counts.
|
||||
/// D38 (owner decision 2026-10-03): the game's successful sessions under ONE grant of its user-mode exception — hooked
|
||||
/// under <paramref name="family"/> (<c>sessions.ac_exception_family</c>), started at or after <paramref name="grantedAt"/>,
|
||||
/// frames recorded, <c>exit_status = normal</c>: how far that grant's trial has come against
|
||||
/// <c>UserModeExceptionRules.TrialSessions</c>. Since beta.8 <c>normal</c> includes End task's exit code 1 and a user's
|
||||
/// stop; a crashed, unhooked-for-safety, degraded or interrupted session never counts, and neither does a session from
|
||||
/// before the grant or under an earlier one.
|
||||
/// </summary>
|
||||
ValueTask<int> CountSuccessfulHookedAsync(long gameId, CancellationToken ct = default);
|
||||
ValueTask<int> CountSuccessfulUnderGrantAsync(long gameId, string family, DateTimeOffset grantedAt, CancellationToken ct = default);
|
||||
|
||||
ValueTask<int> SweepRetentionAsync(long gameId, int keep, CancellationToken ct = default);
|
||||
|
||||
@@ -57,6 +59,13 @@ public interface ISessionRepository
|
||||
/// </summary>
|
||||
ValueTask<RetentionSweepResult> SweepRetentionAllAsync(int keep, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): delete every session of <paramref name="gameId"/>, or of every game when it is null, in
|
||||
/// one transaction — segments, frame and sensor series and annotations cascade with them (schema 0001's foreign keys).
|
||||
/// Nothing about the games, their consent or the settings is touched. The Agent's to call (§Writer ownership).
|
||||
/// </summary>
|
||||
ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default);
|
||||
|
||||
ValueTask<FrameBlobs?> FindFramesAsync(long sessionId, CancellationToken ct = default);
|
||||
|
||||
/// <summary>The session's segments in frame order (the ribbon, <c>08_UI</c> §Session summary).</summary>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace FrameLedger.Application.Recording;
|
||||
|
||||
/// <summary>
|
||||
/// D38: the session the recorder just finished, as the exception's trial needs it — the game row it was stored under,
|
||||
/// whether it was stored as a hooked session, and the frames it recorded.
|
||||
/// </summary>
|
||||
/// <param name="GameId">The <c>games</c> row the session belongs to.</param>
|
||||
/// <param name="StoredHooked">It was hooked AND its row was written (a session too short to keep proves nothing).</param>
|
||||
/// <param name="FrameCount">Frames the row records.</param>
|
||||
public readonly record struct SessionForTrial(long GameId, bool StoredHooked, long FrameCount);
|
||||
@@ -217,10 +217,12 @@ public sealed class SessionRecorder : ISessionRecorder
|
||||
}
|
||||
|
||||
// D33: a session under the game's user-mode exception that ended badly ends the exception — after the row is
|
||||
// stored, so the session that ended it is on the page the exception is gone from.
|
||||
// stored, so the session that ended it is on the page the exception is gone from. D38: during the grant's trial a
|
||||
// stored hooked session that did not succeed ends it too, and any end then is for good.
|
||||
var trial = new SessionForTrial(ownerId, hooked && saved.Status == FinalizeStatus.Saved, built.Row.FrameCount);
|
||||
string? lapsed = _exceptionLapse is null
|
||||
? null
|
||||
: await _exceptionLapse.ApplyAsync(request.NormalisedExePath, outcome, exit, ct).ConfigureAwait(false);
|
||||
: await _exceptionLapse.ApplyAsync(request.NormalisedExePath, outcome, exit, trial, ct).ConfigureAwait(false);
|
||||
|
||||
return new RecordedSession
|
||||
{
|
||||
|
||||
@@ -1,34 +1,47 @@
|
||||
using FrameLedger.Application.AntiCheat;
|
||||
using FrameLedger.Application.Capture;
|
||||
using FrameLedger.Application.Consent;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Domain.Consent;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Shared;
|
||||
|
||||
namespace FrameLedger.Application.Recording;
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): what a session under a game's user-mode exception does to the exception when it ends
|
||||
/// badly (<c>19_SAFETY</c> §The user-mode exception, What ends it). A finding about the game at its start or at the 30 s
|
||||
/// re-scan, a safety unhook, the Overlay's own stop on another anti-cheat's module, and a crash while hooked each end it —
|
||||
/// the evidence the exception rests on said "this game is safe to measure", and each of those says otherwise.
|
||||
/// D33 (owner decision 2026-09-26) as amended by D38 (2026-10-03): what a session under a game's user-mode exception does to
|
||||
/// the exception when it ends (<c>19_SAFETY</c> §The user-mode exception, What ends it). A finding about the game at its
|
||||
/// start or at the 30 s re-scan, a safety unhook, the Overlay's own stop on another anti-cheat's module, and a crash while
|
||||
/// hooked each end it — the trust the exception rests on said "this game is safe to measure", and each of those says
|
||||
/// otherwise. D38: during the grant's trial (its first <see cref="UserModeExceptionRules.TrialSessions"/> successful
|
||||
/// sessions) a hooked session that recorded no frame or did not end normally ends it too, and any end during the trial
|
||||
/// marks the game so that no exception can be made for it again.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>It only ever ends an exception.</b> Nothing here grants one or clears a block; the end turns the game's hooking off
|
||||
/// while its block stands and keeps the consent stamp, as a block keeps it. The user may grant it again once the sweep
|
||||
/// finds the game eligible again, through the disclosure.
|
||||
/// while its block stands and keeps the consent stamp, as a block keeps it. After the trial the user may grant it again
|
||||
/// once the sweep finds the game eligible again, through the disclosure; after an end during the trial, never.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// A session that ran under no exception is left alone, and so is an ordinary end under one — the game exited, the user
|
||||
/// stopped it, End task (beta.8's <c>normal</c>), a refusal that found nothing about the game.
|
||||
/// stopped it, End task (beta.8's <c>normal</c>), a refusal that found nothing about the game — and a session too short to
|
||||
/// be stored, which proves nothing either way.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class UserModeExceptionLapsePolicy
|
||||
{
|
||||
private readonly IGameConsentStore _consent;
|
||||
private readonly ISessionRepository? _sessions;
|
||||
|
||||
public UserModeExceptionLapsePolicy(IGameConsentStore consent) =>
|
||||
/// <summary>The policy over the store that holds the exception, and the sessions its trial is counted in.</summary>
|
||||
/// <param name="consent">Where the exception lives.</param>
|
||||
/// <param name="sessions">Where a grant's trial is counted (D38); without it no end is judged against a trial.</param>
|
||||
public UserModeExceptionLapsePolicy(IGameConsentStore consent, ISessionRepository? sessions = null)
|
||||
{
|
||||
_consent = consent ?? throw new ArgumentNullException(nameof(consent));
|
||||
_sessions = sessions;
|
||||
}
|
||||
|
||||
/// <summary>Why <paramref name="outcome"/> ends the exception it ran under (<see cref="UserModeExceptionLapse"/>), or null.</summary>
|
||||
public static string? LapseOf(CaptureOutcome outcome, ExitStatus exit)
|
||||
@@ -60,18 +73,75 @@ public sealed class UserModeExceptionLapsePolicy
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>End the exception when <see cref="LapseOf"/> says so; the reason, when it was ended.</summary>
|
||||
public async ValueTask<string?> ApplyAsync(string normalisedExePath, CaptureOutcome outcome, ExitStatus exit, CancellationToken ct = default)
|
||||
/// <summary>
|
||||
/// D38: whether the session in <paramref name="session"/> succeeded as a trial counts it — stored hooked, frames
|
||||
/// recorded, <c>normal</c> (<c>ISessionRepository.CountSuccessfulUnderGrantAsync</c>'s rule, for the row just written).
|
||||
/// </summary>
|
||||
public static bool Succeeded(SessionForTrial session, ExitStatus exit) =>
|
||||
session.StoredHooked && exit == ExitStatus.Normal && session.FrameCount > 0;
|
||||
|
||||
/// <summary>
|
||||
/// The end <paramref name="outcome"/> brings its exception, given whether the grant is still in its trial: a reason
|
||||
/// from <see cref="LapseOf"/>, or <see cref="UserModeExceptionLapse.TrialFailed"/> for a stored hooked session that did
|
||||
/// not succeed during the trial, or null. Pure, for the tests and for <see cref="ApplyAsync"/>.
|
||||
/// </summary>
|
||||
public static string? EndOf(CaptureOutcome outcome, ExitStatus exit, SessionForTrial? session, bool inTrial)
|
||||
{
|
||||
string? lapse = LapseOf(outcome, exit);
|
||||
if (lapse is not null || !inTrial || session is not { } s || outcome.ExceptionFamily is null)
|
||||
{
|
||||
return lapse;
|
||||
}
|
||||
|
||||
return s.StoredHooked && !Succeeded(s, exit) ? UserModeExceptionLapse.TrialFailed : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End the exception when <see cref="EndOf"/> says so — marking the game when the end came during the trial — and
|
||||
/// return the reason when it was ended. <paramref name="session"/> is the row the recorder just wrote (null when it
|
||||
/// wrote none it can describe).
|
||||
/// </summary>
|
||||
public async ValueTask<string?> ApplyAsync(string normalisedExePath, CaptureOutcome outcome, ExitStatus exit, SessionForTrial? session = null,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(normalisedExePath);
|
||||
string? lapse = LapseOf(outcome, exit);
|
||||
ArgumentNullException.ThrowIfNull(outcome);
|
||||
if (outcome.ExceptionFamily is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
bool inTrial = await InTrialAsync(normalisedExePath, session, exit, ct).ConfigureAwait(false);
|
||||
string? lapse = EndOf(outcome, exit, session, inTrial);
|
||||
if (lapse is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return await _consent.RevokeAntiCheatExceptionAsync(normalisedExePath, lapse, ct).ConfigureAwait(false) == ConsentWriteOutcome.Written
|
||||
return await _consent.RevokeAntiCheatExceptionAsync(normalisedExePath, lapse, trialFailed: inTrial, ct).ConfigureAwait(false) == ConsentWriteOutcome.Written
|
||||
? lapse
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// D38: the grant in force right now is still in its trial — fewer than <see cref="UserModeExceptionRules.TrialSessions"/>
|
||||
/// successful sessions under it besides this one. No grant, no count: not in a trial.
|
||||
/// </summary>
|
||||
private async ValueTask<bool> InTrialAsync(string normalisedExePath, SessionForTrial? session, ExitStatus exit, CancellationToken ct)
|
||||
{
|
||||
if (_sessions is null || session is not { } s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GameConsentRecord record = await _consent.FindAsync(normalisedExePath, ct).ConfigureAwait(false);
|
||||
if (record.Exception is not { } grant)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int counted = await _sessions.CountSuccessfulUnderGrantAsync(s.GameId, grant.Family, grant.GrantedAt, ct).ConfigureAwait(false);
|
||||
int before = Succeeded(s, exit) ? Math.Max(0, counted - 1) : counted;
|
||||
return UserModeExceptionRules.InTrial(before);
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,18 @@ public static class SettingsRegistry
|
||||
Default = "0",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// How the Games library is shown (beta.11, owner request 2026-10-03): a grid of cards that fills the width, or a list.
|
||||
/// The page's own switch writes it; Settings has no row for it.
|
||||
/// </summary>
|
||||
public static readonly SettingDefinition UiLibraryView = new()
|
||||
{
|
||||
Key = "ui.library_view",
|
||||
Kind = SettingKind.Choice,
|
||||
Default = "grid",
|
||||
Choices = ["grid", "list"],
|
||||
};
|
||||
|
||||
/// <summary>Whether the Agent's watcher records tracked games that the App did not launch (FR-3.1/FR-3.3).</summary>
|
||||
public static readonly SettingDefinition CaptureBackground = new()
|
||||
{
|
||||
@@ -178,7 +190,7 @@ public static class SettingsRegistry
|
||||
/// <summary>Every definition, in the order <c>06_DATA_MODEL</c> lists them.</summary>
|
||||
public static IReadOnlyList<SettingDefinition> All { get; } =
|
||||
[
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals,
|
||||
UiLanguage, UiTheme, UiStartWithWindows, UiMinimizeToTray, UiHideAntiCheatHooking, UiFpsDecimals, UiLibraryView,
|
||||
CaptureBackground, HookingKillSwitch, HookingUserModeExceptions, CaptureRunElevated, CaptureMinSessionSeconds, TelemetryIntervalMs, RetentionRawSessionsPerGame,
|
||||
UpdateChannel, UpdateAutoCheck, PrivacyOnlineMetadata, LogDebug,
|
||||
];
|
||||
|
||||
@@ -104,6 +104,15 @@ public sealed class CaptureOrchestrator
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Whether any session started here is still running — what deleting every session waits for (beta.11).</summary>
|
||||
public bool IsRecordingAny()
|
||||
{
|
||||
lock (_table)
|
||||
{
|
||||
return _running.Values.Any(static r => !r.Task.IsCompleted);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Poll until cancelled, then wait for every running session to finalize.</summary>
|
||||
public async Task RunAsync(CancellationToken ct)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
-- 0017 (2026-10-03, beta.11, owner decision D38): the user-mode anti-cheat exception's trial (19_SAFETY §The user-mode
|
||||
-- exception).
|
||||
--
|
||||
-- D33 asked for two successful Tier-1 sessions before an exception could be granted. Since beta.8 the library sweep
|
||||
-- blocks a game the moment it is added, so a blocked game could never be hooked to earn them, and a reset ledger lost the
|
||||
-- ones it had: the exception was unreachable for every game blocked from the start. D38 grants without them; the first two
|
||||
-- hooked sessions under a grant are its trial, and an end during the trial — a crash, a safety unhook, the Overlay's own
|
||||
-- stop, a new finding, or a session that recorded no frame or did not end normally — ends the exception for good.
|
||||
--
|
||||
-- ac_exception_trial_failed_at is that "for good": when an exception of this game ended during its trial, NULL when none
|
||||
-- did. Nothing clears it — not a withdrawal, a game update, Change executable or the end of a later grant (there is none:
|
||||
-- while it is set the Agent finds the game not eligible and the store refuses a grant in SQL). A twin merge keeps the
|
||||
-- earlier of two. ac_exception_sessions (0014) is now the trial's progress under the grant in force.
|
||||
--
|
||||
-- Written by the Agent only (06_DATA_MODEL §Writer ownership: the exception's columns are the Agent's); ADD COLUMN only.
|
||||
|
||||
ALTER TABLE games ADD COLUMN ac_exception_trial_failed_at INTEGER;
|
||||
@@ -81,22 +81,28 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
|
||||
// D33 (schema 0014). The eligibility and the grant are each bound to the block they were reached about — the WHERE is
|
||||
// the guarantee, so a block rewritten between the caller's read and this write leaves the row alone. Neither names
|
||||
// hook_blocked_reason, hook_enabled or the consent columns in its SET list.
|
||||
// hook_blocked_reason, hook_enabled or the consent columns in its SET list. D38 (schema 0017): a game an exception of
|
||||
// which failed its trial is never eligible and is never granted one — in SQL, whatever the caller read.
|
||||
private const string _exceptionEligibility =
|
||||
"UPDATE games SET ac_exception_eligible = @eligible, ac_exception_verdict = @verdict, ac_exception_sessions = @sessions, "
|
||||
"UPDATE games SET ac_exception_eligible = CASE WHEN ac_exception_trial_failed_at IS NULL THEN @eligible ELSE 0 END, "
|
||||
+ "ac_exception_verdict = @verdict, ac_exception_sessions = @sessions, "
|
||||
+ "ac_exception_checked_rules_version = @rules, ac_exception_checked_exe_size_bytes = @size, ac_exception_checked_exe_mtime_ms = @mtime, "
|
||||
+ "ac_exception_checked_block = @block, updated_at = @at WHERE exe_path = @path AND hook_blocked_reason = @block";
|
||||
|
||||
private const string _exceptionGrant =
|
||||
"UPDATE games SET ac_exception_at = @at, ac_exception_family = @family, ac_exception_disclosure_version = @disclosure, "
|
||||
+ "ac_exception_exe_size_bytes = @size, ac_exception_exe_mtime_ms = @mtime, ac_exception_lapsed_at = NULL, ac_exception_lapsed_reason = NULL, "
|
||||
+ "ac_exception_eligible = 1, ac_exception_verdict = @verdict, ac_exception_sessions = @sessions, updated_at = @at "
|
||||
+ "WHERE exe_path = @path AND hook_blocked_reason = @block";
|
||||
+ "ac_exception_eligible = 1, ac_exception_verdict = @verdict, ac_exception_sessions = 0, updated_at = @at "
|
||||
+ "WHERE exe_path = @path AND hook_blocked_reason = @block AND ac_exception_trial_failed_at IS NULL";
|
||||
|
||||
private const string _trialFailedOf = "SELECT ac_exception_trial_failed_at FROM games WHERE exe_path = @path";
|
||||
|
||||
// The end of an exception keeps the consent stamp, as a block does, and turns hooking off while the block stands. The
|
||||
// grant's family, disclosure and bytes stay as history; ac_exception_at going NULL is what ends it.
|
||||
// grant's family, disclosure and bytes stay as history; ac_exception_at going NULL is what ends it. D38: an end during
|
||||
// the trial also sets ac_exception_trial_failed_at, once, and nothing ever clears it.
|
||||
private const string _exceptionRevoke =
|
||||
"UPDATE games SET ac_exception_at = NULL, ac_exception_lapsed_at = @at, ac_exception_lapsed_reason = @reason, "
|
||||
+ "ac_exception_trial_failed_at = CASE WHEN @trialFailed = 1 THEN COALESCE(ac_exception_trial_failed_at, @at) ELSE ac_exception_trial_failed_at END, "
|
||||
+ "hook_enabled = CASE WHEN hook_blocked_reason IS NOT NULL THEN 0 ELSE hook_enabled END, updated_at = @at "
|
||||
+ "WHERE exe_path = @path AND ac_exception_at IS NOT NULL";
|
||||
|
||||
@@ -306,7 +312,8 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(block);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(rulesVersion);
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(StoredBlock.Parse(block), v, sessions);
|
||||
// The trial mark (D38) is the row's, and the SQL applies it: this says what the verdict alone allows.
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(StoredBlock.Parse(block), v, trialFailed: false);
|
||||
try
|
||||
{
|
||||
return await _db.WriteAsync(async (c, tx, token) =>
|
||||
@@ -340,9 +347,10 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(grant.DisclosureVersion, nameof(grant));
|
||||
|
||||
// THE STORE APPLIES THE RULE ITSELF: a grant over facts that do not make the game eligible is refused here, not
|
||||
// only by the caller that gathered them.
|
||||
// only by the caller that gathered them — and a game whose exception once failed its trial (D38) is refused from
|
||||
// the row, in the same transaction as the write.
|
||||
StoredBlock? block = StoredBlock.Parse(grant.Block);
|
||||
if (!UserModeExceptionRules.IsEligible(block, grant.Verdict, grant.Sessions))
|
||||
if (!UserModeExceptionRules.IsEligible(block, grant.Verdict, trialFailed: false))
|
||||
{
|
||||
return ConsentWriteOutcome.NotEligible;
|
||||
}
|
||||
@@ -351,6 +359,13 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
{
|
||||
return await _db.WriteAsync(async (c, tx, token) =>
|
||||
{
|
||||
long? trialFailedAt = await c.ExecuteScalarAsync<long?>(new CommandDefinition(_trialFailedOf, new { path = grant.Fingerprint.ExePath }, tx,
|
||||
cancellationToken: token)).ConfigureAwait(false);
|
||||
if (trialFailedAt is not null)
|
||||
{
|
||||
return ConsentWriteOutcome.NotEligible;
|
||||
}
|
||||
|
||||
var p = new
|
||||
{
|
||||
path = grant.Fingerprint.ExePath,
|
||||
@@ -360,7 +375,6 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
size = grant.Fingerprint.SizeBytes,
|
||||
mtime = grant.Fingerprint.MtimeUnixMs,
|
||||
verdict = BlockText(grant.Verdict),
|
||||
sessions = grant.Sessions,
|
||||
at = grant.GrantedAt.ToUnixTimeMilliseconds(),
|
||||
};
|
||||
int rows = await c.ExecuteAsync(new CommandDefinition(_exceptionGrant, p, tx, cancellationToken: token)).ConfigureAwait(false);
|
||||
@@ -374,7 +388,8 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, CancellationToken ct = default)
|
||||
public async ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, bool trialFailed = false,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(normalisedExePath);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(reason);
|
||||
@@ -382,7 +397,7 @@ public sealed class SqliteGameConsentStore : IGameConsentStore
|
||||
{
|
||||
return await _db.WriteAsync(async (c, tx, token) =>
|
||||
{
|
||||
var p = new { path = normalisedExePath, reason, at = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() };
|
||||
var p = new { path = normalisedExePath, reason, trialFailed = trialFailed ? 1 : 0, at = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() };
|
||||
int rows = await c.ExecuteAsync(new CommandDefinition(_exceptionRevoke, p, tx, cancellationToken: token)).ConfigureAwait(false);
|
||||
return rows == 0 ? ConsentWriteOutcome.NotFound : ConsentWriteOutcome.Written;
|
||||
}, ct).ConfigureAwait(false);
|
||||
|
||||
@@ -28,18 +28,22 @@ namespace FrameLedger.Infrastructure.Persistence;
|
||||
/// <b>The recording switch (schema 0009) follows the same direction:</b> off on either entry is off on the survivor. The
|
||||
/// user turned it off for this executable under one of its two names.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>So does a failed exception trial (schema 0017, D38):</b> an exception of either entry that ended during its trial
|
||||
/// marks the survivor, the earlier of two — a merge must not be the way a game's "never again" disappears.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class SqliteGameMerge : IGameMerge
|
||||
{
|
||||
private const string _read =
|
||||
"SELECT id, exe_path, exe_size_bytes, exe_mtime_ms, removed_at, hook_enabled, hook_blocked_reason, hook_autodisabled_reason, "
|
||||
+ "hook_autodisabled_at, hook_crash_count, hook_last_injected_at, record_sessions FROM games WHERE id = @id";
|
||||
+ "hook_autodisabled_at, hook_crash_count, hook_last_injected_at, record_sessions, ac_exception_trial_failed_at FROM games WHERE id = @id";
|
||||
|
||||
private const string _reparent = "UPDATE sessions SET game_id = @keep WHERE game_id = @drop";
|
||||
|
||||
private const string _carry =
|
||||
"UPDATE games SET hook_blocked_reason = @blocked, hook_autodisabled_reason = @autoReason, hook_autodisabled_at = @autoAt, "
|
||||
+ "hook_crash_count = @crashes, hook_last_injected_at = @injected, record_sessions = @record, "
|
||||
+ "hook_crash_count = @crashes, hook_last_injected_at = @injected, record_sessions = @record, ac_exception_trial_failed_at = @trialFailed, "
|
||||
+ "hook_enabled = CASE WHEN @hookOff THEN 0 ELSE hook_enabled END, "
|
||||
+ "hook_prescan_state = CASE WHEN @blockCarried THEN 'blocked' ELSE hook_prescan_state END, "
|
||||
+ "updated_at = @now WHERE id = @keep";
|
||||
@@ -81,6 +85,7 @@ public sealed class SqliteGameMerge : IGameMerge
|
||||
crashes = keep.CrashCount + drop!.CrashCount,
|
||||
injected = Later(keep.LastInjectedAt, drop.LastInjectedAt),
|
||||
record = keep.RecordSessions && drop.RecordSessions ? 1 : 0,
|
||||
trialFailed = Earlier(keep.TrialFailedAt, drop.TrialFailedAt),
|
||||
hookOff = blockCarried || autoCarried,
|
||||
blockCarried,
|
||||
now,
|
||||
@@ -112,6 +117,8 @@ public sealed class SqliteGameMerge : IGameMerge
|
||||
|
||||
private static long? Later(long? a, long? b) => a is null ? b : b is null ? a : Math.Max(a.Value, b.Value);
|
||||
|
||||
private static long? Earlier(long? a, long? b) => a is null ? b : b is null ? a : Math.Min(a.Value, b.Value);
|
||||
|
||||
private static Task<Twin?> ReadAsync(SqliteConnection c, SqliteTransaction tx, long id, CancellationToken ct) =>
|
||||
SqliteReaders.ReadOneAsync(c, new CommandDefinition(_read, new { id }, tx, cancellationToken: ct), Read);
|
||||
|
||||
@@ -127,7 +134,8 @@ public sealed class SqliteGameMerge : IGameMerge
|
||||
SqliteReaders.Int64(r, 8),
|
||||
r.GetInt32(9),
|
||||
SqliteReaders.Int64(r, 10),
|
||||
r.GetInt64(11) != 0);
|
||||
r.GetInt64(11) != 0,
|
||||
SqliteReaders.Int64(r, 12));
|
||||
|
||||
private sealed record Twin(
|
||||
long Id,
|
||||
@@ -141,5 +149,6 @@ public sealed class SqliteGameMerge : IGameMerge
|
||||
long? AutoDisabledAt,
|
||||
int CrashCount,
|
||||
long? LastInjectedAt,
|
||||
bool RecordSessions);
|
||||
bool RecordSessions,
|
||||
long? TrialFailedAt);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
+ "ac_exception_eligible, ac_exception_verdict, ac_exception_sessions, ac_exception_checked_rules_version, "
|
||||
+ "ac_exception_checked_exe_size_bytes, ac_exception_checked_exe_mtime_ms, ac_exception_checked_block, ac_exception_at, "
|
||||
+ "ac_exception_family, ac_exception_disclosure_version, ac_exception_exe_size_bytes, ac_exception_exe_mtime_ms, "
|
||||
+ "ac_exception_lapsed_at, ac_exception_lapsed_reason, engine_version_source";
|
||||
+ "ac_exception_lapsed_at, ac_exception_lapsed_reason, engine_version_source, ac_exception_trial_failed_at";
|
||||
|
||||
private const string _selectByPath = $"SELECT {_columns} FROM games WHERE exe_path = @path";
|
||||
|
||||
@@ -373,8 +373,8 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
ExeFileVersion = SqliteReaders.String(r, 36),
|
||||
ExeProductVersion = SqliteReaders.String(r, 37),
|
||||
Libraries = LibraryVersionsJson.Parse(SqliteReaders.String(r, 38)),
|
||||
AcException = ReadException(r),
|
||||
EngineVersionSource = SqliteReaders.String(r, 53), // schema 0015, the last column in _columns
|
||||
AcException = ReadException(r) with { TrialFailedAt = At(SqliteReaders.Int64(r, 54)) }, // schema 0017, the last column
|
||||
EngineVersionSource = SqliteReaders.String(r, 53), // schema 0015
|
||||
};
|
||||
|
||||
/// <summary>Schema 0014's columns, 39 onwards in <see cref="_columns"/>' order.</summary>
|
||||
|
||||
@@ -165,10 +165,14 @@ public sealed class SqliteSessionRepository : ISessionRepository
|
||||
_db.ReadAsync((c, token) => c.ExecuteScalarAsync<long>(new CommandDefinition(
|
||||
"SELECT COUNT(*) FROM sessions WHERE started_at >= @since", new { since = since.ToUnixTimeMilliseconds() }, cancellationToken: token)), ct);
|
||||
|
||||
public ValueTask<int> CountSuccessfulHookedAsync(long gameId, CancellationToken ct = default) =>
|
||||
_db.ReadAsync((c, token) => c.ExecuteScalarAsync<int>(new CommandDefinition(
|
||||
"SELECT COUNT(*) FROM sessions WHERE game_id = @gameId AND capture_tier = 1 AND exit_status = 'normal' AND frame_count > 0",
|
||||
new { gameId }, cancellationToken: token)), ct);
|
||||
public ValueTask<int> CountSuccessfulUnderGrantAsync(long gameId, string family, DateTimeOffset grantedAt, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(family);
|
||||
return _db.ReadAsync((c, token) => c.ExecuteScalarAsync<int>(new CommandDefinition(
|
||||
"SELECT COUNT(*) FROM sessions WHERE game_id = @gameId AND ac_exception_family = @family AND started_at >= @since "
|
||||
+ "AND capture_tier = 1 AND exit_status = 'normal' AND frame_count > 0",
|
||||
new { gameId, family, since = grantedAt.ToUnixTimeMilliseconds() }, cancellationToken: token)), ct);
|
||||
}
|
||||
|
||||
public ValueTask<IReadOnlyList<SegmentRow>> FindSegmentsAsync(long sessionId, CancellationToken ct = default) =>
|
||||
_db.ReadAsync((c, token) => SqliteReaders.ReadAllAsync(
|
||||
@@ -213,6 +217,20 @@ public sealed class SqliteSessionRepository : ISessionRepository
|
||||
}, ct);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (D40): one transaction — count what goes, then delete; <c>PRAGMA foreign_keys = ON</c> (LedgerDatabase) lets
|
||||
/// segments, frame and sensor series and annotations go with their sessions.
|
||||
/// </summary>
|
||||
public ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default) =>
|
||||
_db.WriteAsync(async (c, tx, token) =>
|
||||
{
|
||||
const string scope = "FROM sessions WHERE (@gameId IS NULL OR game_id = @gameId)";
|
||||
long games = await c.ExecuteScalarAsync<long>(new CommandDefinition("SELECT COUNT(DISTINCT game_id) " + scope, new { gameId }, tx,
|
||||
cancellationToken: token)).ConfigureAwait(false);
|
||||
int sessions = await c.ExecuteAsync(new CommandDefinition("DELETE " + scope, new { gameId }, tx, cancellationToken: token)).ConfigureAwait(false);
|
||||
return new RetentionSweepResult(checked((int)games), sessions);
|
||||
}, ct);
|
||||
|
||||
public ValueTask<FrameBlobs?> FindFramesAsync(long sessionId, CancellationToken ct = default) =>
|
||||
_db.ReadAsync((c, token) => SqliteReaders.ReadOneAsync(
|
||||
c, new CommandDefinition(_selectFrames, new { sessionId }, cancellationToken: token), ReadFrames), ct);
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace FrameLedger.Shared.Ipc;
|
||||
[JsonSerializable(typeof(ShutdownAck))]
|
||||
[JsonSerializable(typeof(SweepRetentionRequest))]
|
||||
[JsonSerializable(typeof(SweepRetentionAck))]
|
||||
[JsonSerializable(typeof(DeleteSessionsRequest))]
|
||||
[JsonSerializable(typeof(DeleteSessionsAck))]
|
||||
public sealed partial class IpcJsonContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
@@ -57,6 +57,13 @@ public static class IpcMessageType
|
||||
public const string SweepRetention = "SweepRetention";
|
||||
public const string SweepRetentionAck = "SweepRetentionAck";
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): delete every session of one game, or of every game — the Agent's rows (§Writer
|
||||
/// ownership), deleted by the Agent, refused while a session it would delete under is still being recorded.
|
||||
/// </summary>
|
||||
public const string DeleteSessions = "DeleteSessions";
|
||||
public const string DeleteSessionsAck = "DeleteSessionsAck";
|
||||
|
||||
public const string SessionStarted = "SessionStarted";
|
||||
public const string SessionProgress = "SessionProgress";
|
||||
|
||||
@@ -96,6 +103,9 @@ public static class IpcErrorCode
|
||||
|
||||
/// <summary>D33: <c>SetAntiCheatException true</c> while <c>hooking.usermode_ac_exceptions</c> is off — nothing is granted.</summary>
|
||||
public const string ExceptionsOff = "ExceptionsOff";
|
||||
|
||||
/// <summary>beta.11: <c>DeleteSessions</c> while a session of that game (or of any game, for all) is being recorded — nothing is deleted.</summary>
|
||||
public const string SessionRunning = "SessionRunning";
|
||||
}
|
||||
|
||||
/// <summary>Codes a <see cref="CaptureErrorEvent"/> carries (<c>07_IPC</c> §Messages, <c>CaptureError</c>).</summary>
|
||||
@@ -362,3 +372,13 @@ public sealed record SweepRetentionRequest;
|
||||
/// series were removed. Aggregates and segments are never touched.
|
||||
/// </summary>
|
||||
public sealed record SweepRetentionAck(int Keep, int Games, int Sessions);
|
||||
|
||||
/// <summary>
|
||||
/// <c>DeleteSessions</c> (beta.11, D40): every session of <see cref="GameId"/>, or of every game when it is null — with
|
||||
/// their segments, frame and sensor series and annotations (they cascade). The library, the settings and every consent
|
||||
/// stay. Refused with <c>Error SessionRunning</c> while such a session is being recorded.
|
||||
/// </summary>
|
||||
public sealed record DeleteSessionsRequest(long? GameId);
|
||||
|
||||
/// <summary>What was deleted: the sessions, and how many games they belonged to.</summary>
|
||||
public sealed record DeleteSessionsAck(long? GameId, int Games, int Sessions);
|
||||
@@ -12,5 +12,5 @@ namespace FrameLedger.Shared.Safety;
|
||||
/// </remarks>
|
||||
public static class AntiCheatExceptionDisclosure
|
||||
{
|
||||
public const string Version = "ac-exception-dialog/1";
|
||||
public const string Version = "ac-exception-dialog/2";
|
||||
}
|
||||
+3
@@ -61,6 +61,7 @@ public static class Strings
|
||||
nameof(Safety_Exception_Risk_Format),
|
||||
nameof(Safety_Exception_Still_Format),
|
||||
nameof(Safety_Exception_Title_Format),
|
||||
nameof(Safety_Exception_Trial),
|
||||
nameof(Safety_Exception_VersionMismatch),
|
||||
nameof(Safety_Exception_Why_Format),
|
||||
nameof(Safety_HookingTurnedOff),
|
||||
@@ -142,6 +143,8 @@ public static class Strings
|
||||
|
||||
public static string Safety_Exception_Title_Format => ResourceManager.GetString(nameof(Safety_Exception_Title_Format), Culture) ?? nameof(Safety_Exception_Title_Format);
|
||||
|
||||
public static string Safety_Exception_Trial => ResourceManager.GetString(nameof(Safety_Exception_Trial), Culture) ?? nameof(Safety_Exception_Trial);
|
||||
|
||||
public static string Safety_Exception_VersionMismatch => ResourceManager.GetString(nameof(Safety_Exception_VersionMismatch), Culture) ?? nameof(Safety_Exception_VersionMismatch);
|
||||
|
||||
public static string Safety_Exception_Why_Format => ResourceManager.GetString(nameof(Safety_Exception_Why_Format), Culture) ?? nameof(Safety_Exception_Why_Format);
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
<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>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>The exception is offered because {0} runs entirely in user mode — no kernel driver, no service and no driver file in the game's folder — and FrameLedger has already measured this game hooked, successfully, {1} times.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>The exception is offered because {0} runs entirely in user mode — no kernel driver, no service and no driver file in the game's folder.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Trial" xml:space="preserve"><value>The first two sessions you play hooked under the exception are a trial. If either one does not go well — it crashes, records no frames, does not end normally, is stopped for safety, or something new is found — the exception ends, and no exception can be made for this game again. Two good sessions do not prove that the anti-cheat did not notice.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Risk_Format" xml:space="preserve"><value>The risk is the same as before, and it is yours. {0} is anti-cheat. It may detect FrameLedger in the game and warn, block or permanently ban your account — possibly days later, and FrameLedger cannot know whether it did. Sessions that went well before are no promise about the next one, or about the next update of the anti-cheat.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Still_Format" xml:space="preserve"><value>Under the exception the guard still runs every check, and still refuses a kernel driver in the game's folder, any other anti-cheat, an anti-cheat driver or service on this machine, a scan it cannot finish, and a title it refuses by name. The exception covers {0} and nothing else.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>The exception ends by itself when something new is found, when a session under it crashes or is stopped for safety, when FrameLedger stops observing because another anti-cheat loaded, or when the game is updated. Turning the option off in Settings suspends it. You can withdraw it at any time.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>After the trial, the exception ends by itself when something new is found, when a session under it crashes or is stopped for safety, when FrameLedger stops observing because another anti-cheat loaded, or when the game is updated; you may then make it again. Turning the option off in Settings suspends it. You can withdraw it at any time.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Next" xml:space="preserve"><value>Making the exception does not turn hooking on. You turn hooking on for this game afterwards, through the usual consent dialog.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Online" xml:space="preserve"><value>FrameLedger is intended for offline and single-player play. Do not use this exception with a game you play online or competitively unless you accept losing that account.</value><comment>safety: human review required</comment></data>
|
||||
<data name="Safety_Exception_Accept" xml:space="preserve"><value>I accept the risk of a ban for this game</value><comment>safety: human review required</comment></data>
|
||||
|
||||
@@ -39,10 +39,11 @@
|
||||
<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>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>The exception is offered because {0} runs entirely in user mode — no kernel driver, no service and no driver file in the game's folder — and FrameLedger has already measured this game hooked, successfully, {1} times.</value></data>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>The exception is offered because {0} runs entirely in user mode — no kernel driver, no service and no driver file in the game's folder.</value></data>
|
||||
<data name="Safety_Exception_Trial" xml:space="preserve"><value>The first two sessions you play hooked under the exception are a trial. If either one does not go well — it crashes, records no frames, does not end normally, is stopped for safety, or something new is found — the exception ends, and no exception can be made for this game again. Two good sessions do not prove that the anti-cheat did not notice.</value></data>
|
||||
<data name="Safety_Exception_Risk_Format" xml:space="preserve"><value>The risk is the same as before, and it is yours. {0} is anti-cheat. It may detect FrameLedger in the game and warn, block or permanently ban your account — possibly days later, and FrameLedger cannot know whether it did. Sessions that went well before are no promise about the next one, or about the next update of the anti-cheat.</value></data>
|
||||
<data name="Safety_Exception_Still_Format" xml:space="preserve"><value>Under the exception the guard still runs every check, and still refuses a kernel driver in the game's folder, any other anti-cheat, an anti-cheat driver or service on this machine, a scan it cannot finish, and a title it refuses by name. The exception covers {0} and nothing else.</value></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>The exception ends by itself when something new is found, when a session under it crashes or is stopped for safety, when FrameLedger stops observing because another anti-cheat loaded, or when the game is updated. Turning the option off in Settings suspends it. You can withdraw it at any time.</value></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>After the trial, the exception ends by itself when something new is found, when a session under it crashes or is stopped for safety, when FrameLedger stops observing because another anti-cheat loaded, or when the game is updated; you may then make it again. Turning the option off in Settings suspends it. You can withdraw it at any time.</value></data>
|
||||
<data name="Safety_Exception_Next" xml:space="preserve"><value>Making the exception does not turn hooking on. You turn hooking on for this game afterwards, through the usual consent dialog.</value></data>
|
||||
<data name="Safety_Exception_Online" xml:space="preserve"><value>FrameLedger is intended for offline and single-player play. Do not use this exception with a game you play online or competitively unless you accept losing that account.</value></data>
|
||||
<data name="Safety_Exception_Accept" xml:space="preserve"><value>I accept the risk of a ban for this game</value></data>
|
||||
|
||||
@@ -33,10 +33,11 @@
|
||||
<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>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>Ngoại lệ được đề xuất vì {0} chạy hoàn toàn ở user mode — không có kernel driver, không có service và không có tệp driver nào trong thư mục game — và FrameLedger đã đo game này ở chế độ hook thành công {1} lần.</value></data>
|
||||
<data name="Safety_Exception_Why_Format" xml:space="preserve"><value>Ngoại lệ được đề xuất vì {0} chạy hoàn toàn ở user mode — không có kernel driver, không có service và không có tệp driver nào trong thư mục game.</value></data>
|
||||
<data name="Safety_Exception_Trial" xml:space="preserve"><value>Hai phiên đầu tiên bạn chơi có hook dưới ngoại lệ là phiên thử. Nếu một trong hai không ổn — bị crash, không ghi được frame nào, không kết thúc bình thường, bị dừng vì an toàn, hoặc phát hiện điều gì mới — ngoại lệ sẽ kết thúc và không thể tạo ngoại lệ cho game này nữa. Hai phiên tốt không chứng minh rằng anti-cheat đã không phát hiện.</value></data>
|
||||
<data name="Safety_Exception_Risk_Format" xml:space="preserve"><value>Rủi ro vẫn như trước, và bạn là người chịu. {0} là anti-cheat. Nó có thể phát hiện FrameLedger trong game và cảnh báo, chặn hoặc khoá vĩnh viễn tài khoản của bạn — có thể sau nhiều ngày, và FrameLedger không thể biết điều đó có xảy ra hay không. Các phiên đã chạy ổn trước đây không bảo đảm gì cho phiên tiếp theo, hay cho bản cập nhật tiếp theo của anti-cheat.</value></data>
|
||||
<data name="Safety_Exception_Still_Format" xml:space="preserve"><value>Dưới ngoại lệ, bộ bảo vệ vẫn chạy mọi bước kiểm tra, và vẫn từ chối khi có kernel driver trong thư mục game, bất kỳ anti-cheat nào khác, driver hay service anti-cheat trên máy này, một lần quét không hoàn tất, và các tựa game bị từ chối theo tên. Ngoại lệ chỉ áp dụng cho {0}, không gì khác.</value></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>Ngoại lệ tự kết thúc khi phát hiện điều gì mới, khi một phiên dưới ngoại lệ bị crash hoặc bị dừng vì an toàn, khi FrameLedger ngừng quan sát vì một anti-cheat khác được nạp, hoặc khi game được cập nhật. Tắt tuỳ chọn trong Cài đặt sẽ tạm ngưng nó. Bạn có thể rút lại bất cứ lúc nào.</value></data>
|
||||
<data name="Safety_Exception_Ends" xml:space="preserve"><value>Sau thời gian thử, ngoại lệ tự kết thúc khi phát hiện điều gì mới, khi một phiên dưới ngoại lệ bị crash hoặc bị dừng vì an toàn, khi FrameLedger ngừng quan sát vì một anti-cheat khác được nạp, hoặc khi game được cập nhật; khi đó bạn có thể tạo lại. Tắt tuỳ chọn trong Cài đặt sẽ tạm ngưng nó. Bạn có thể rút lại bất cứ lúc nào.</value></data>
|
||||
<data name="Safety_Exception_Next" xml:space="preserve"><value>Tạo ngoại lệ không bật hooking. Sau đó bạn tự bật hooking cho game này qua hộp thoại đồng ý thông thường.</value></data>
|
||||
<data name="Safety_Exception_Online" xml:space="preserve"><value>FrameLedger dành cho chơi offline và chơi đơn. Đừng dùng ngoại lệ này với game bạn chơi online hoặc thi đấu, trừ khi bạn chấp nhận mất tài khoản đó.</value></data>
|
||||
<data name="Safety_Exception_Accept" xml:space="preserve"><value>Tôi chấp nhận rủi ro bị khoá tài khoản cho game này</value></data>
|
||||
|
||||
@@ -3704,6 +3704,20 @@ TEST_CASE("a listed store id refuses as BlockedStoreId, naming its family", "[gu
|
||||
CHECK(g.lastStoreRoot == L"C:\\Games\\Example"); // the install root check 4 walks, derived from the pid
|
||||
}
|
||||
|
||||
TEST_CASE("the CrackProof titles refuse by their Steam ids, naming CrackProof", "[guard][check3][store]") {
|
||||
// Rules 2026.10.1 (owner's list, 2026-10-03): the floor carries them, so a rules file cannot take one off.
|
||||
for (const char* id : {"steam:3224770", "steam:1973710", "steam:2987800"}) {
|
||||
ResetFake();
|
||||
g.storeIdentity = id;
|
||||
const Verdict v = EvaluateWithSources(1234, FakeSources());
|
||||
INFO(id);
|
||||
REQUIRE_FALSE(v.Allowed());
|
||||
CHECK(v.reason == Reason::kBlockedStoreId);
|
||||
CHECK(std::strcmp(v.family, "CrackProof") == 0);
|
||||
CHECK(std::strcmp(v.signal, id) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("an install no store names is not refused by the store half", "[guard][check3][store]") {
|
||||
ResetFake();
|
||||
g.storeIdentity = "";
|
||||
|
||||
@@ -17,7 +17,7 @@ public sealed class AntiCheatExceptionsTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private static readonly AntiCheatExceptionFacts _gf2 = new("GIRLS' FRONTLINE 2: EXILIUM", "NetEase Yidun", "NEP2.dll", 3);
|
||||
private static readonly AntiCheatExceptionFacts _gf2 = new("GIRLS' FRONTLINE 2: EXILIUM", "NetEase Yidun", "NEP2.dll");
|
||||
|
||||
private static HelloAck Hello(string? exceptionDisclosure) =>
|
||||
new("agent", IpcProtocol.Version, 1, false, "b", false, "l1", false, SafetyDisclosure.Version, exceptionDisclosure);
|
||||
@@ -102,13 +102,14 @@ public sealed class AntiCheatExceptionsTests
|
||||
var agent = new FakeAgent
|
||||
{
|
||||
Hello = Hello(AntiCheatExceptionDisclosure.Version),
|
||||
Answer = static _ => Ack(IpcMessageType.Refused, new RefusedAck(56, "TooFewSessions", "NetEase Yidun", "1")),
|
||||
// D38: a game whose exception once failed its trial is refused for good; the signal is when, in unix ms.
|
||||
Answer = static _ => Ack(IpcMessageType.Refused, new RefusedAck(56, "TrialFailed", "NetEase Yidun", "1759449600000")),
|
||||
};
|
||||
var exceptions = new AntiCheatExceptions(agent, new FakePrompt { Accepts = true });
|
||||
|
||||
AntiCheatExceptionResult few = await exceptions.GrantAsync(56, _gf2, Ct);
|
||||
few.Outcome.Should().Be(AntiCheatExceptionOutcome.Refused);
|
||||
few.RefusalText().Should().Contain("1");
|
||||
AntiCheatExceptionResult failed = await exceptions.GrantAsync(56, _gf2, Ct);
|
||||
failed.Outcome.Should().Be(AntiCheatExceptionOutcome.Refused);
|
||||
failed.RefusalText().Should().Contain("trial").And.Contain(Formats.Date(DateTimeOffset.FromUnixTimeMilliseconds(1759449600000)));
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.ExceptionsOff, "off");
|
||||
(await exceptions.GrantAsync(56, _gf2, Ct)).Outcome.Should().Be(AntiCheatExceptionOutcome.OptionOff);
|
||||
@@ -140,7 +141,8 @@ public sealed class AntiCheatExceptionsTests
|
||||
|
||||
viewModel.Accepted.Should().BeFalse("the dialog opens with the risk unaccepted");
|
||||
viewModel.Intro.Should().Contain("NetEase Yidun").And.Contain("NEP2.dll");
|
||||
viewModel.Why.Should().Contain("3");
|
||||
viewModel.Why.Should().Contain("NetEase Yidun").And.NotContain("{1}", "D38: the disclosure names no session count");
|
||||
AntiCheatExceptionDialogViewModel.Trial.Should().Contain("trial", "D38: the grant's first two sessions are a trial, and the disclosure says so");
|
||||
viewModel.Risk.Should().Contain("NetEase Yidun");
|
||||
viewModel.Accepted = true;
|
||||
viewModel.Accepted.Should().BeTrue();
|
||||
|
||||
@@ -66,9 +66,17 @@ public sealed class GameDetailViewModelTests
|
||||
public void GoBack() => Pages.Add("back");
|
||||
}
|
||||
|
||||
private sealed class FakeConfirmations(RemoveGameChoice choice) : IConfirmations
|
||||
private sealed class FakeConfirmations(RemoveGameChoice choice, bool deleteSessions = false) : IConfirmations
|
||||
{
|
||||
public List<(string? Game, long Sessions)> DeleteAsked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(choice);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
DeleteAsked.Add((gameName, sessions));
|
||||
return Task.FromResult(deleteSessions);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FakeEdit(GameMetadata? answer) : IEditGamePrompt
|
||||
@@ -474,7 +482,11 @@ public sealed class GameDetailViewModelTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>D33: a game the guard would let through but with one hooked session says so; a kernel-level family says why not.</summary>
|
||||
/// <summary>
|
||||
/// D33: why a game is not eligible is said on its page — a kernel-level family, a guard that also found something else.
|
||||
/// D38 (2026-10-03): a failed trial says it is for good; a scan that found nothing of the family says so (it finished);
|
||||
/// and an ELIGIBLE game's anti-cheat card no longer says hooking "cannot be turned on" beside its Make exception button.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task WhyAGameIsNotEligibleIsSaidOnItsPage()
|
||||
{
|
||||
@@ -483,47 +495,33 @@ public sealed class GameDetailViewModelTests
|
||||
try
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow few = await s.GameAsync("Few");
|
||||
GameRow aniimo = await s.GameAsync("Aniimo");
|
||||
GameRow eac = await s.GameAsync("Eac");
|
||||
await s.Db.WriteAsync(async (c, tx, ct) =>
|
||||
{
|
||||
const string sql = "UPDATE games SET hook_blocked_reason = @block, hook_prescan_state = 'blocked', ac_exception_verdict = @verdict, "
|
||||
+ "ac_exception_sessions = @sessions, ac_exception_checked_block = @block WHERE id = @id";
|
||||
await Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(sql, new
|
||||
{
|
||||
id = few.Id,
|
||||
block = "AntiCheatFile|NetEase Yidun|NEP2.dll",
|
||||
verdict = "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll",
|
||||
sessions = 1
|
||||
}, tx, cancellationToken: ct)).ConfigureAwait(false);
|
||||
await Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(sql, new
|
||||
{
|
||||
id = aniimo.Id,
|
||||
block = "AntiCheatFile|NetEase Yidun|NEP2.dll",
|
||||
verdict = "AntiCheatFile|Kernel driver in the game folder|NEPKernel.sys",
|
||||
sessions = 1
|
||||
}, tx, cancellationToken: ct)).ConfigureAwait(false);
|
||||
await Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(sql, new
|
||||
{
|
||||
id = eac.Id,
|
||||
block = "AntiCheatDirectory|Easy Anti-Cheat|EasyAntiCheat",
|
||||
verdict = "AntiCheatDirectory|Easy Anti-Cheat|EasyAntiCheat",
|
||||
sessions = 4
|
||||
}, tx, cancellationToken: ct)).ConfigureAwait(false);
|
||||
return 0;
|
||||
}, Ct);
|
||||
const string yidun = "AntiCheatFile|NetEase Yidun|NEP2.dll";
|
||||
const string through = "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll";
|
||||
long failed = await BlockedWithAnswerAsync(s, "Failed", yidun, through, eligible: false, trialFailedAt: 1_759_449_600_000);
|
||||
long gone = await BlockedWithAnswerAsync(s, "Gone", yidun, "Allow||", eligible: false);
|
||||
long eligible = await BlockedWithAnswerAsync(s, "GF2", yidun, through, eligible: true);
|
||||
long aniimo = await BlockedWithAnswerAsync(s, "Aniimo", yidun, "AntiCheatFile|Kernel driver in the game folder|NEPKernel.sys", eligible: false);
|
||||
long eac = await BlockedWithAnswerAsync(s, "Eac", "AntiCheatDirectory|Easy Anti-Cheat|EasyAntiCheat", "AntiCheatDirectory|Easy Anti-Cheat|EasyAntiCheat",
|
||||
eligible: false);
|
||||
var settings = new RegisteredSettings(new MemorySettings());
|
||||
await settings.SetAsync(SettingsRegistry.HookingUserModeExceptions, true, Ct);
|
||||
|
||||
(GameDetailViewModel vm, _, _, _, _) = await BuildAsync(s, few.Id, settings: settings);
|
||||
vm.ExceptionText.Should().Contain("1").And.Contain("two");
|
||||
(GameDetailViewModel vm, _, _, _, _) = await BuildAsync(s, failed, settings: settings);
|
||||
vm.ExceptionText.Should().Contain("trial").And.Contain("none can be made again");
|
||||
vm.CanGrantException.Should().BeFalse();
|
||||
vm.AntiCheatText.Should().Contain("cannot be turned on", "nothing can be made for it");
|
||||
|
||||
(vm, _, _, _, _) = await BuildAsync(s, aniimo.Id, settings: settings);
|
||||
(vm, _, _, _, _) = await BuildAsync(s, gone, settings: settings);
|
||||
vm.ExceptionText.Should().Contain("NetEase Yidun").And.Contain("was not found", "the check finished and confirmed nothing");
|
||||
|
||||
(vm, _, _, _, _) = await BuildAsync(s, eligible, settings: settings);
|
||||
vm.CanGrantException.Should().BeTrue("D38: no session is needed");
|
||||
vm.AntiCheatText.Should().Contain("unless you make a user-mode exception").And.NotContain("cannot be turned on");
|
||||
|
||||
(vm, _, _, _, _) = await BuildAsync(s, aniimo, settings: settings);
|
||||
vm.ExceptionText.Should().Contain("Kernel driver in the game folder").And.Contain("NEPKernel.sys");
|
||||
|
||||
(vm, _, _, _, _) = await BuildAsync(s, eac.Id, settings: settings);
|
||||
(vm, _, _, _, _) = await BuildAsync(s, eac, settings: settings);
|
||||
vm.ExceptionText.Should().Contain("Easy Anti-Cheat").And.Contain("not user-mode");
|
||||
}
|
||||
finally
|
||||
@@ -532,6 +530,17 @@ public sealed class GameDetailViewModelTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A blocked game the Agent has answered about: the block, the tolerant verdict, eligibility and a D38 trial mark.</summary>
|
||||
private static async Task<long> BlockedWithAnswerAsync(ScratchLedger s, string name, string block, string verdict, bool eligible, long? trialFailedAt = null)
|
||||
{
|
||||
GameRow game = await s.GameAsync(name).ConfigureAwait(false);
|
||||
const string sql = "UPDATE games SET hook_blocked_reason = @block, hook_prescan_state = 'blocked', ac_exception_verdict = @verdict, "
|
||||
+ "ac_exception_eligible = @eligible, ac_exception_trial_failed_at = @failedAt, ac_exception_checked_block = @block WHERE id = @id";
|
||||
await s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(sql,
|
||||
new { id = game.Id, block, verdict, eligible = eligible ? 1 : 0, failedAt = trialFailedAt }, tx, cancellationToken: ct)), Ct).ConfigureAwait(false);
|
||||
return game.Id;
|
||||
}
|
||||
|
||||
/// <summary>The library card says "Anti-cheat" for such a game (beta.8) — after "Not recorded", which says more.</summary>
|
||||
[Fact]
|
||||
public async Task TheLibraryCardSaysAntiCheatForAGameTheGuardFoundItIn()
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Controls;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner requests 2026-10-03): the library page counts its games, reloads itself while on screen when a session
|
||||
/// ends or an import adds games, lets go when it leaves, and its grid's columns fill the width.
|
||||
/// </summary>
|
||||
public sealed class GamesViewModelTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private sealed class NoNavigation : IPageNavigator
|
||||
{
|
||||
public void Navigate<TPage>()
|
||||
where TPage : class
|
||||
{
|
||||
}
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
}
|
||||
|
||||
private sealed class NoStrip : IMessageStrip
|
||||
{
|
||||
public void Info(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Success(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Warn(string title, string body)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ThePageOnScreenReloadsWhenAnImportAddsGamesOrASessionEndsAndNotAfterItLeaves()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
var selection = new GameSelection();
|
||||
var nav = new NoNavigation();
|
||||
var link = new FakeAgentLink();
|
||||
var changes = new LibraryChanges();
|
||||
var vm = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, new NoStrip()), agent: link, changes: changes);
|
||||
Task loaded = vm.Pending;
|
||||
await loaded;
|
||||
vm.HeaderText.Should().EndWith("1");
|
||||
vm.Attach();
|
||||
vm.Attach(); // a second Loaded does not subscribe twice
|
||||
|
||||
_ = await s.GameAsync("Bravo");
|
||||
changes.Announce();
|
||||
Task afterImport = vm.Pending;
|
||||
await afterImport;
|
||||
vm.Games.Should().HaveCount(2, "an import made from the menu while the page is on screen");
|
||||
vm.HeaderText.Should().EndWith("2");
|
||||
|
||||
long session = await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow);
|
||||
link.Raise(IpcMessageType.SessionCompleted, new SessionCompletedEvent(Guid.NewGuid(), session, "normal", 1, "saved", "exited", alpha.Id, "Alpha"));
|
||||
Task afterSession = vm.Pending;
|
||||
await afterSession;
|
||||
vm.Games.Single(static g => string.Equals(g.Name, "Alpha", StringComparison.Ordinal)).SessionCount.Should().Be(1);
|
||||
|
||||
vm.Detach();
|
||||
Task before = vm.Pending;
|
||||
_ = await s.GameAsync("Charlie");
|
||||
changes.Announce();
|
||||
vm.Pending.Should().BeSameAs(before, "a page that left holds nothing and reloads nothing");
|
||||
vm.Games.Should().HaveCount(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ACardSaysWhetherItsExecutableIsThereAndWhy()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow row = await s.GameAsync("Gone", @"Q:\Games\Gone\gone.exe");
|
||||
|
||||
new GameCardViewModel(new GameCard(row, null)).NotInstalled.Should().BeFalse("installed unless the listing said otherwise");
|
||||
var missing = new GameCardViewModel(new GameCard(row, null), installed: false);
|
||||
missing.NotInstalled.Should().BeTrue();
|
||||
missing.NotInstalledToolTip.Should().Be(Formats.ExecutableMissingText(@"Q:\Games\Gone\gone.exe"), "the game page's own words for why");
|
||||
missing.StatusText.Should().Contain(Strings.Games_Card_NotInstalled);
|
||||
|
||||
await using ScratchLedger s2 = await ScratchLedger.OpenAsync();
|
||||
var listed = new GamesViewModel(s2.Library, new GameSelection(), new NoNavigation(),
|
||||
new AddGameFlow(s2.Library, new NoPicker(), new GameSelection(), new NoNavigation(), new NoStrip()));
|
||||
string here = typeof(GamesViewModelTests).Assembly.Location;
|
||||
_ = await s2.GameAsync("Here", here);
|
||||
_ = await s2.GameAsync("Gone", Path.Combine(AppContext.BaseDirectory, "no-such-game.exe"));
|
||||
await listed.LoadAsync(Ct);
|
||||
listed.Games.Single(static g => string.Equals(g.Name, "Here", StringComparison.Ordinal)).NotInstalled.Should().BeFalse();
|
||||
listed.Games.Single(static g => string.Equals(g.Name, "Gone", StringComparison.Ordinal)).NotInstalled.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1200, 3)]
|
||||
[InlineData(1248, 4)]
|
||||
[InlineData(1235, 3)]
|
||||
[InlineData(624, 2)]
|
||||
[InlineData(250, 1)]
|
||||
[InlineData(double.PositiveInfinity, 1)]
|
||||
public void TheGridHasAsManyColumnsAsFitAtTheMinimumWidth(double width, int columns)
|
||||
{
|
||||
UniformWrapPanel.ColumnsFor(width, 300, 12).Should().Be(columns);
|
||||
if (!double.IsInfinity(width))
|
||||
{
|
||||
double item = UniformWrapPanel.ItemWidthFor(width, columns, 12);
|
||||
item.Should().BeGreaterThanOrEqualTo(columns == 1 ? 0 : 300);
|
||||
((columns * item) + ((columns - 1) * 12)).Should().BeApproximately(width, 0.001, "a row fills the width");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
var importer = new LibraryImporter([store], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { });
|
||||
var flow = new ImportLibraryFlow(importer, review, strip, nav);
|
||||
|
||||
ImportReport? report = await flow.RunAsync(Ct);
|
||||
ImportReport? report = await flow.RunAsync(ct: Ct);
|
||||
|
||||
report.Should().NotBeNull();
|
||||
report!.Added.Should().Be(1);
|
||||
@@ -114,17 +114,55 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
var nav = new FakeNavigator();
|
||||
var review = new ScriptedReview(static _ => null);
|
||||
var empty = new ImportLibraryFlow(new LibraryImporter([new ScriptedStore()], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }), review, strip, nav);
|
||||
(await empty.RunAsync(Ct)).Should().BeNull();
|
||||
(await empty.RunAsync(ct: Ct)).Should().BeNull();
|
||||
strip.Kinds.Should().Equal("info");
|
||||
review.Shown.Should().BeEmpty("nothing to review");
|
||||
|
||||
string exe = await ExeAsync("Game");
|
||||
var cancelled = new ImportLibraryFlow(new LibraryImporter([new ScriptedStore(new StoreGame("epic", "g", "Game", Path.GetDirectoryName(exe)!, exe, null))], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }), review, strip, nav);
|
||||
(await cancelled.RunAsync(Ct)).Should().BeNull();
|
||||
(await cancelled.RunAsync(ct: Ct)).Should().BeNull();
|
||||
(await s.Games.ListAsync(Ct)).Should().BeEmpty();
|
||||
nav.Pages.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: the Games page's Refresh runs the import for new games only — every title already in the library means "no
|
||||
/// new games" and no checklist; a new one opens it, and the page on screen is told the library changed.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RefreshOffersOnlyNewGamesAndSaysWhenThereAreNone()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string old = await ExeAsync("Old");
|
||||
await s.Games.EnsureAsync(new ExecutableIdentitySource().Read(old)!.Value, "Old", Ct);
|
||||
var oldStore = new ScriptedStore(new StoreGame("epic", "old", "Old", Path.GetDirectoryName(old)!, old, null));
|
||||
var review = new ScriptedReview(static c => [.. c.Where(static x => x.CanImport)]);
|
||||
var strip = new RecordingStrip();
|
||||
var nav = new FakeNavigator();
|
||||
var changes = new LibraryChanges();
|
||||
int announced = 0;
|
||||
changes.Changed += (_, _) => announced++;
|
||||
var flow = new ImportLibraryFlow(new LibraryImporter([oldStore], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }),
|
||||
review, strip, nav, changes);
|
||||
|
||||
(await flow.RunAsync(onlyNew: true, Ct)).Should().BeNull();
|
||||
review.Shown.Should().BeEmpty("nothing new, so no checklist");
|
||||
strip.Kinds.Should().Equal("info");
|
||||
announced.Should().Be(0);
|
||||
|
||||
string fresh = await ExeAsync("Fresh");
|
||||
var both = new ScriptedStore(new StoreGame("epic", "old", "Old", Path.GetDirectoryName(old)!, old, null),
|
||||
new StoreGame("epic", "fresh", "Fresh", Path.GetDirectoryName(fresh)!, fresh, null));
|
||||
flow = new ImportLibraryFlow(new LibraryImporter([both], s.Games, new ExecutableIdentitySource(), new ExecutableLocator(), static _ => { }),
|
||||
review, strip, nav, changes);
|
||||
|
||||
ImportReport? report = await flow.RunAsync(onlyNew: true, Ct);
|
||||
|
||||
report!.Added.Should().Be(1);
|
||||
announced.Should().Be(1, "the Games page on screen reloads");
|
||||
nav.Pages.Should().Equal(nameof(GamesPage));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheReviewCountsTicksAndSelectAllSkipsWhatCannotBeImported()
|
||||
{
|
||||
@@ -150,4 +188,33 @@ public sealed class ImportLibraryFlowTests : IDisposable
|
||||
vm.SelectedCount.Should().Be(1);
|
||||
vm.Selected.Should().ContainSingle().Which.Should().Be(can);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner request 2026-10-03): the games already in the library — at this path or under another drive letter —
|
||||
/// are hidden by default and come back, still unimportable, when the user asks; the count names how many.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GamesAlreadyInTheLibraryAreHiddenUntilAskedFor()
|
||||
{
|
||||
var can = new ImportCandidate(new StoreGame("steam", "1", "A", @"C:\a", @"C:\a\a.exe", null), @"C:\a\a.exe", AlreadyInLibrary: false, ExecutableGuessed: false);
|
||||
var already = new ImportCandidate(new StoreGame("steam", "2", "B", @"C:\b", @"C:\b\b.exe", null), @"C:\b\b.exe", AlreadyInLibrary: true, ExecutableGuessed: false);
|
||||
var none = new ImportCandidate(new StoreGame("steam", "3", "C", @"C:\c", null, null), null, AlreadyInLibrary: false, ExecutableGuessed: true);
|
||||
var moved = new ImportCandidate(new StoreGame("steam", "4", "D", @"D:\d", @"D:\d\d.exe", null), @"D:\d\d.exe", AlreadyInLibrary: false, ExecutableGuessed: false,
|
||||
MovedFrom: @"H:\d\d.exe");
|
||||
var vm = new ImportReviewViewModel([can, already, none, moved]);
|
||||
|
||||
vm.ExistingCount.Should().Be(2);
|
||||
vm.HasExisting.Should().BeTrue();
|
||||
vm.ShowExistingText.Should().Contain("2");
|
||||
vm.Shown.Select(static r => r.Name).Should().Equal(["A", "C"], "a title with no executable is new and says why it cannot be imported");
|
||||
|
||||
vm.ShowExisting = true;
|
||||
vm.Shown.Select(static r => r.Name).Should().Equal(["A", "B", "C", "D"]);
|
||||
vm.Shown.Where(static r => r.IsExisting).Should().OnlyContain(static r => !r.CanImport, "shown dimmed, never importable");
|
||||
|
||||
vm.SelectAllCommand.Execute(null);
|
||||
vm.SelectedCount.Should().Be(1, "showing them makes them no more importable");
|
||||
vm.ShowExisting = false;
|
||||
vm.Shown.Should().HaveCount(2);
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,8 @@ public sealed class PagesLoadTests
|
||||
|
||||
private sealed class NoConfirm : IConfirmations
|
||||
{
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default) => Task.FromResult(false);
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
}
|
||||
|
||||
@@ -253,6 +255,102 @@ public sealed class PagesLoadTests
|
||||
element.UpdateLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner request 2026-10-03: "the empty band on the right"): the library's cards share the whole width — every
|
||||
/// card in a row as wide as the others, the row as wide as the panel — and the list view renders with the grid gone, the
|
||||
/// choice remembered. Under the real dictionaries, so a style or binding typo is red here.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheLibraryGridFillsItsWidthAndTheListViewReplacesIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
foreach (string name in new[] { "Alpha", "Bravo", "Charlie", "Delta", "Echo" })
|
||||
{
|
||||
_ = await s.GameAsync(name);
|
||||
}
|
||||
|
||||
var selection = new GameSelection();
|
||||
var nav = new NoNavigation();
|
||||
var strip = new NoStrip();
|
||||
var settings = new MemorySettings();
|
||||
var games = new GamesViewModel(s.Library, selection, nav, new AddGameFlow(s.Library, new NoPicker(), selection, nav, strip),
|
||||
settings: new RegisteredSettings(settings));
|
||||
Task pending = games.Pending;
|
||||
await pending;
|
||||
games.HeaderText.Should().EndWith("5");
|
||||
games.Games.Should().OnlyContain(static g => g.NotInstalled, "the scratch entries point at files that do not exist");
|
||||
|
||||
(double PanelWidth, double[] CardWidths, int Columns) grid = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new GamesPage(games);
|
||||
Render(page);
|
||||
UniformWrapPanel panel = Find<UniformWrapPanel>(page)!;
|
||||
double[] widths = [.. panel.Children.Cast<FrameworkElement>().Select(static c => c.ActualWidth)];
|
||||
return (panel.ActualWidth, widths, UniformWrapPanel.ColumnsFor(panel.ActualWidth, panel.MinItemWidth, panel.Spacing));
|
||||
});
|
||||
|
||||
grid.Columns.Should().BeGreaterThan(1);
|
||||
grid.CardWidths.Should().OnlyContain(w => Math.Abs(w - grid.CardWidths[0]) < 0.5, "every card is an equal share");
|
||||
((grid.Columns * grid.CardWidths[0]) + ((grid.Columns - 1) * 12)).Should().BeApproximately(grid.PanelWidth, 1, "a full row leaves no band unused");
|
||||
|
||||
games.ShowListCommand.Execute(null);
|
||||
(bool ListShown, bool GridShown) list = await OnStaAsync(() =>
|
||||
{
|
||||
var page = new GamesPage(games);
|
||||
Render(page);
|
||||
return (((FrameworkElement)page.FindName("GameList")).Visibility == Visibility.Visible,
|
||||
((FrameworkElement)page.FindName("CardGrid")).Visibility == Visibility.Visible);
|
||||
});
|
||||
|
||||
list.ListShown.Should().BeTrue();
|
||||
list.GridShown.Should().BeFalse();
|
||||
settings.Rows.Should().ContainKey("ui.library_view").WhoseValue.Should().Be("list", "the choice is remembered");
|
||||
}
|
||||
|
||||
/// <summary>beta.11: the import checklist renders with the rows already in the library shown, dimmed, under the real dictionaries.</summary>
|
||||
[Fact]
|
||||
public async Task TheImportChecklistRendersWithTheExistingRowsShown()
|
||||
{
|
||||
var vm = new ImportReviewViewModel(
|
||||
[
|
||||
new Application.Import.ImportCandidate(new Application.Import.StoreGame("steam", "1", "A", @"C:\a", @"C:\a\a.exe", null), @"C:\a\a.exe",
|
||||
AlreadyInLibrary: false, ExecutableGuessed: false),
|
||||
new Application.Import.ImportCandidate(new Application.Import.StoreGame("steam", "2", "B", @"C:\b", @"C:\b\b.exe", null), @"C:\b\b.exe",
|
||||
AlreadyInLibrary: true, ExecutableGuessed: false),
|
||||
])
|
||||
{ ShowExisting = true };
|
||||
|
||||
int rows = await OnStaAsync(() =>
|
||||
{
|
||||
var content = new Dialogs.ImportReviewContent(vm);
|
||||
Render(content);
|
||||
return Find<System.Windows.Controls.DataGrid>(content)!.Items.Count;
|
||||
});
|
||||
|
||||
rows.Should().Be(2);
|
||||
}
|
||||
|
||||
/// <summary>The first descendant of <paramref name="root"/> of type <typeparamref name="T"/> in the visual tree, or null.</summary>
|
||||
private static T? Find<T>(DependencyObject root)
|
||||
where T : DependencyObject
|
||||
{
|
||||
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(root); i++)
|
||||
{
|
||||
DependencyObject child = System.Windows.Media.VisualTreeHelper.GetChild(root, i);
|
||||
if (child is T hit)
|
||||
{
|
||||
return hit;
|
||||
}
|
||||
|
||||
if (Find<T>(child) is { } deeper)
|
||||
{
|
||||
return deeper;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.8 (owner request 2026-09-25): an anti-cheat game's page under the real dictionaries — the finding's card is
|
||||
/// rendered, and the Hooking card, whose switch could only be refused, is not while <c>ui.hide_anticheat_hooking</c> is
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Infrastructure.Ipc;
|
||||
using FrameLedger.Shared.Ipc;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// beta.11: Delete all sessions (owner decision D40) through the Agent, from the game page; and the charts across a game's
|
||||
/// sessions (D39) — the Sessions tab's overview, and the Trend's second metric and second unit.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class SessionDeletionAndOverviewTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
/// <summary>An Agent that answers DeleteSessions as scripted, and records what it was asked.</summary>
|
||||
private sealed class ScriptedAgent : IAgentRequests
|
||||
{
|
||||
public HelloAck? Hello => null;
|
||||
|
||||
public bool IsConnected { get; set; } = true;
|
||||
|
||||
public List<DeleteSessionsRequest> Asked { get; } = [];
|
||||
|
||||
public Func<DeleteSessionsRequest, Task<IpcEnvelope>> Answer { get; set; } = static r =>
|
||||
Task.FromResult(IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(r.GameId, 1, 2))));
|
||||
|
||||
public Task<IpcEnvelope> RequestAsync<TRequest>(string type, TRequest payload, CancellationToken ct = default)
|
||||
where TRequest : class
|
||||
{
|
||||
type.Should().Be(IpcMessageType.DeleteSessions);
|
||||
var request = (DeleteSessionsRequest)(object)payload;
|
||||
Asked.Add(request);
|
||||
return Answer(request);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Confirm(bool yes) : IConfirmations
|
||||
{
|
||||
public List<(string? Game, long Sessions)> Asked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
Asked.Add((gameName, sessions));
|
||||
return Task.FromResult(yes);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class Strip : IMessageStrip
|
||||
{
|
||||
public List<string> Lines { get; } = [];
|
||||
|
||||
public void Info(string title, string body) => Lines.Add("info:" + body);
|
||||
|
||||
public void Success(string title, string body) => Lines.Add("success:" + body);
|
||||
|
||||
public void Warn(string title, string body) => Lines.Add("warn:" + body);
|
||||
}
|
||||
|
||||
private sealed class Nav : IPageNavigator
|
||||
{
|
||||
public void Navigate<TPage>()
|
||||
where TPage : class
|
||||
{
|
||||
}
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoEdit : IEditGamePrompt
|
||||
{
|
||||
public Task<GameMetadata?> EditAsync(GameMetadata current, string? provenanceJson, CancellationToken ct = default) => Task.FromResult<GameMetadata?>(null);
|
||||
}
|
||||
|
||||
private sealed class NoSummaries : ISessionSummaryOpener
|
||||
{
|
||||
public void Open(long sessionId)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NoPicker : IGamePicker
|
||||
{
|
||||
public string? PickExecutable() => null;
|
||||
}
|
||||
|
||||
/// <summary>The summary windows, counting how often they were asked to close the deleted sessions' ones.</summary>
|
||||
private sealed class Windows : ISessionWindows
|
||||
{
|
||||
public int Asked { get; private set; }
|
||||
|
||||
public Task CloseDeletedAsync(CancellationToken ct = default)
|
||||
{
|
||||
Asked++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The scripted Agent deletes for real, as the Agent's repository would.</summary>
|
||||
private static Func<DeleteSessionsRequest, Task<IpcEnvelope>> DeletesFrom(ScratchLedger s) => async r =>
|
||||
{
|
||||
RetentionSweepResult gone = await s.Sessions.DeleteSessionsAsync(r.GameId, Ct).ConfigureAwait(false);
|
||||
return IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(r.GameId, gone.Games, gone.Sessions)));
|
||||
};
|
||||
|
||||
private sealed class NoPrompt : IConsentPrompt
|
||||
{
|
||||
public Task<bool> ShowAsync(string gameName, CancellationToken ct = default) => Task.FromResult(false);
|
||||
}
|
||||
|
||||
private static async Task<GameDetailViewModel> PageAsync(ScratchLedger s, long gameId, IConfirmations confirm, SessionDeletion? deletion, IMessageStrip strip,
|
||||
SessionSelection? selection = null)
|
||||
{
|
||||
var vm = new GameDetailViewModel(s.Library, new GameSelection { GameId = gameId }, new HookingConsent(new ScriptedAgent(), new NoPrompt()), new Nav(),
|
||||
confirm, new NoEdit(), strip, new NoSummaries(), new SessionSeriesLoader(s.Sessions),
|
||||
new Infrastructure.Persistence.SqliteHardwareSnapshotRepository(s.Db), selection ?? new SessionSelection(), new NoPicker(), deletion: deletion);
|
||||
Task pending = vm.Pending;
|
||||
await pending.ConfigureAwait(false);
|
||||
return vm;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheRequestSaysWhatTheAgentDidOrWhyNothingWasDeleted()
|
||||
{
|
||||
var agent = new ScriptedAgent();
|
||||
var deletion = new SessionDeletion(agent);
|
||||
|
||||
SessionDeletionResult done = await deletion.DeleteAsync(7, Ct);
|
||||
done.Should().Be(new SessionDeletionResult(SessionDeletionOutcome.Deleted, 1, 2));
|
||||
done.Message.Should().Contain("2");
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(7));
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.SessionRunning, "running");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.SessionRunning);
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.UnknownType, "older agent");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.AgentTooOld);
|
||||
|
||||
agent.IsConnected = false;
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.AgentUnavailable);
|
||||
agent.Asked.Should().HaveCount(3, "nothing is asked of an Agent that is not there");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The game page asks first and deletes nothing on a no; on a yes the Agent deletes, the page says so, reloads empty, and
|
||||
/// File ▸ Export no longer points at a session that is gone.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheGamePageAsksThenTheAgentDeletesAndThePageReloads()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
long first = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
|
||||
var strip = new Strip();
|
||||
var agent = new ScriptedAgent();
|
||||
GameDetailViewModel no = await PageAsync(s, game.Id, new Confirm(false), new SessionDeletion(agent), strip);
|
||||
await no.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
agent.Asked.Should().BeEmpty("a no deletes nothing");
|
||||
no.Sessions.Should().HaveCount(2);
|
||||
|
||||
agent.Answer = DeletesFrom(s);
|
||||
var confirm = new Confirm(true);
|
||||
var selection = new SessionSelection();
|
||||
selection.Set(first);
|
||||
GameDetailViewModel yes = await PageAsync(s, game.Id, confirm, new SessionDeletion(agent, s.Sessions, selection), strip, selection);
|
||||
await yes.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
|
||||
confirm.Asked.Should().Equal(("Alpha", 2L));
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(game.Id));
|
||||
yes.Sessions.Should().BeEmpty();
|
||||
yes.SessionsEmpty.Should().BeTrue();
|
||||
strip.Lines.Should().ContainSingle(static l => l.StartsWith("success:", StringComparison.Ordinal));
|
||||
selection.SessionId.Should().BeNull("an id that is gone can be reused by the next session");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// After a delete — from the game page or from Settings — SessionDeletion lets go of what still names a deleted session:
|
||||
/// File ▸ Export's selection (a session that is still there stays selected) and the summary windows. A refused delete
|
||||
/// touches neither.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AfterADeleteWhatNamedADeletedSessionLetsGoOfIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
GameRow beta = await s.GameAsync("Beta");
|
||||
long gone = await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
long kept = await s.SessionAsync(beta.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
|
||||
var agent = new ScriptedAgent { Answer = DeletesFrom(s) };
|
||||
var selection = new SessionSelection();
|
||||
var windows = new Windows();
|
||||
var deletion = new SessionDeletion(agent, s.Sessions, selection, windows);
|
||||
|
||||
selection.Set(gone);
|
||||
(await deletion.DeleteAsync(alpha.Id, Ct)).Outcome.Should().Be(SessionDeletionOutcome.Deleted);
|
||||
selection.SessionId.Should().BeNull("Export would otherwise name a session that is gone, or the next one to take its id");
|
||||
windows.Asked.Should().Be(1, "the summary windows close the deleted sessions' ones");
|
||||
|
||||
selection.Set(kept);
|
||||
(await deletion.DeleteAsync(alpha.Id, Ct)).Outcome.Should().Be(SessionDeletionOutcome.Deleted);
|
||||
selection.SessionId.Should().Be(kept, "the other game's session is still there");
|
||||
windows.Asked.Should().Be(2);
|
||||
|
||||
agent.Answer = static _ => throw new IpcRequestException(IpcErrorCode.SessionRunning, "running");
|
||||
(await deletion.DeleteAsync(null, Ct)).Outcome.Should().Be(SessionDeletionOutcome.SessionRunning);
|
||||
selection.SessionId.Should().Be(kept, "nothing was deleted");
|
||||
windows.Asked.Should().Be(2, "nothing was deleted");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// D39: the overview draws every hooked session's rate and lows; the Trend draws a ticked metric beside the selected
|
||||
/// one, a second unit on the right, and offers no third unit.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheOverviewAndTheTrendDrawSeveralMetricsTwoUnitsAtMost()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-2), native: 60);
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddDays(-1), native: 70);
|
||||
GameDetailViewModel vm = await PageAsync(s, game.Id, new Confirm(false), null, new Strip());
|
||||
|
||||
vm.OverviewVisible.Should().BeTrue();
|
||||
vm.OverviewLines.Should().NotBeEmpty().And.OnlyContain(static l => l.Unit == Strings.Trend_Unit_Fps && l.Points.Count == 2);
|
||||
vm.OverviewLines.Select(static l => l.Label).Should().NotContain(Strings.Trend_Metric_NativeFps,
|
||||
"no session generated frames, so Native would only repeat the Presented line");
|
||||
|
||||
vm.TrendLines.Should().ContainSingle("only the selected metric until another is ticked");
|
||||
TrendMetricOptionViewModel selected = vm.TrendExtras.Single(o => o.Metric == vm.TrendMetric);
|
||||
selected.IsEnabled.Should().BeFalse("the selected metric is not offered beside itself");
|
||||
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = true;
|
||||
vm.TrendLines.Should().HaveCount(2);
|
||||
vm.TrendLines[1].Unit.Should().Be(Strings.Trend_Unit_Celsius);
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.AvgGpuPower).IsEnabled.Should().BeFalse("watts would be a third unit");
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.P1Low).IsEnabled.Should().BeTrue("a frame rate is the first unit");
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxCpuTemp).IsEnabled.Should().BeTrue("°C is already on the chart");
|
||||
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = false;
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.AvgGpuPower).IsEnabled.Should().BeTrue("back to one unit");
|
||||
|
||||
// °C and a frame rate ticked, then the selected metric changed to watts: one of the two ticked units goes, so the
|
||||
// boxes name exactly the lines the chart draws.
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.MaxGpuTemp).IsSelected = true;
|
||||
vm.TrendExtras.Single(static o => o.Metric == TrendMetric.P1Low).IsSelected = true;
|
||||
vm.TrendLines.Select(static l => l.Unit).Distinct(StringComparer.Ordinal).Should().HaveCount(2);
|
||||
vm.TrendMetric = TrendMetric.AvgGpuPower;
|
||||
vm.TrendLines.Select(static l => l.Unit).Distinct(StringComparer.Ordinal).Should().HaveCount(2, "the chart draws two units");
|
||||
vm.TrendLines[0].Unit.Should().Be(TrendSeriesBuilder.UnitOf(TrendMetric.AvgGpuPower));
|
||||
vm.TrendExtras.Count(static o => o.IsSelected).Should().Be(vm.TrendLines.Count - 1, "every ticked box has its line");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(TrendMetric.PresentedFps, "FPS")]
|
||||
[InlineData(TrendMetric.P01Low, "FPS")]
|
||||
[InlineData(TrendMetric.MaxGpuTemp, "°C")]
|
||||
[InlineData(TrendMetric.AvgGpuLoad, "%")]
|
||||
[InlineData(TrendMetric.DisplayBorderlessShare, "%")]
|
||||
[InlineData(TrendMetric.AvgGpuPower, "W")]
|
||||
[InlineData(TrendMetric.AvgRam, "MB")]
|
||||
public void EachMetricHasItsUnit(TrendMetric metric, string unit) => TrendSeriesBuilder.UnitOf(metric).Should().StartWith(unit);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public sealed class SettingsViewModelTests
|
||||
}
|
||||
|
||||
private static async Task<Harness> OpenAsync(ScratchLedger s, FakeAgentLink? agent = null, FakeRun? run = null, FakeMaintenance? maintenance = null, FakeTool? tool = null,
|
||||
IAgentAdminPrompt? adminPrompt = null)
|
||||
IAgentAdminPrompt? adminPrompt = null, IConfirmations? confirmations = null, SessionDeletion? deletion = null)
|
||||
{
|
||||
maintenance ??= new FakeMaintenance();
|
||||
tool ??= new FakeTool();
|
||||
@@ -144,12 +144,71 @@ public sealed class SettingsViewModelTests
|
||||
var shell = new ShellHost(new ServiceCollection().BuildServiceProvider(), null!, null!, closePolicy);
|
||||
// The instance-lock probe is the test's (never the real folder's): no Agent holds it, so a restart never waits.
|
||||
var vm = new SettingsViewModel(appearance, new NoTheme(), shell, settings, s.Library, new HookingConsent(agent, new NoPrompt()), agent, run, strip, maintenance, tool, closePolicy, firstRun,
|
||||
adminPrompt: adminPrompt, agentHeld: static () => false);
|
||||
adminPrompt: adminPrompt, agentHeld: static () => false, confirmations: confirmations, deletion: deletion);
|
||||
Task pending = vm.Pending;
|
||||
await pending.ConfigureAwait(false);
|
||||
return new Harness { Ledger = s, Settings = settings, Agent = agent, Run = run, Strip = strip, Vm = vm, Maintenance = maintenance, Tool = tool, ClosePolicy = closePolicy, FirstRun = firstRun };
|
||||
}
|
||||
|
||||
/// <summary>beta.11 (D40): Settings ▸ Data asks with the total, deletes nothing on a no, and deletes every game's through the Agent on a yes.</summary>
|
||||
[Fact]
|
||||
public async Task DeleteAllSessionsAsksWithTheTotalThenGoesThroughTheAgent()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow alpha = await s.GameAsync("Alpha");
|
||||
GameRow bravo = await s.GameAsync("Bravo");
|
||||
await s.SessionAsync(alpha.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
await s.SessionAsync(bravo.Id, DateTimeOffset.UtcNow.AddHours(-1));
|
||||
var confirm = new DeleteConfirm();
|
||||
var agent = new DeletingAgent(s);
|
||||
Harness h = await OpenAsync(s, confirmations: confirm, deletion: new SessionDeletion(agent));
|
||||
|
||||
await h.Vm.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
confirm.Asked.Should().Equal(((string?)null, 2L));
|
||||
agent.Asked.Should().BeEmpty("a no deletes nothing");
|
||||
|
||||
confirm.Answer = true;
|
||||
await h.Vm.DeleteAllSessionsCommand.ExecuteAsync(null);
|
||||
agent.Asked.Should().Equal(new DeleteSessionsRequest(null));
|
||||
(await s.Sessions.SummariseByGameAsync(Ct)).Should().BeEmpty();
|
||||
(await s.Games.ListAsync(Ct)).Should().HaveCount(2, "the library stays");
|
||||
h.Vm.HasHookedGames.Should().BeFalse("no game has hooking on, so that card is not shown");
|
||||
}
|
||||
|
||||
private sealed class DeleteConfirm : IConfirmations
|
||||
{
|
||||
public bool Answer { get; set; }
|
||||
|
||||
public List<(string? Game, long Sessions)> Asked { get; } = [];
|
||||
|
||||
public Task<RemoveGameChoice> RemoveGameAsync(string gameName, CancellationToken ct = default) => Task.FromResult(RemoveGameChoice.Cancel);
|
||||
|
||||
public Task<bool> DeleteSessionsAsync(string? gameName, long sessions, CancellationToken ct = default)
|
||||
{
|
||||
Asked.Add((gameName, sessions));
|
||||
return Task.FromResult(Answer);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>An Agent that deletes in the scratch ledger as the real one does in its own.</summary>
|
||||
private sealed class DeletingAgent(ScratchLedger s) : IAgentRequests
|
||||
{
|
||||
public HelloAck? Hello => null;
|
||||
|
||||
public bool IsConnected => true;
|
||||
|
||||
public List<DeleteSessionsRequest> Asked { get; } = [];
|
||||
|
||||
public async Task<IpcEnvelope> RequestAsync<TRequest>(string type, TRequest payload, CancellationToken ct = default)
|
||||
where TRequest : class
|
||||
{
|
||||
var request = (DeleteSessionsRequest)(object)payload;
|
||||
Asked.Add(request);
|
||||
RetentionSweepResult gone = await s.Sessions.DeleteSessionsAsync(request.GameId, ct).ConfigureAwait(false);
|
||||
return IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.DeleteSessionsAck, "1", new DeleteSessionsAck(request.GameId, gone.Games, gone.Sessions)));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LoadsTheRegistrysEffectiveValuesAndWritesNothing()
|
||||
{
|
||||
@@ -173,8 +232,9 @@ public sealed class SettingsViewModelTests
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): the option is one Agent-read settings row, off by default; on, the list names the
|
||||
/// games the exception concerns — eligible, held back only by the session count, in force — and off, only a kept
|
||||
/// exception, said to be suspended. The App reads the Agent's columns and writes none.
|
||||
/// games it can act on — eligible, in force — and off, only a kept exception, said to be suspended. A game that can
|
||||
/// never qualify (here: D38's failed trial; or a kernel-level family) is not listed: its page says why. The App reads
|
||||
/// the Agent's columns and writes none.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheExceptionOptionIsOffByDefaultAndItsListFollowsTheAgentsColumns()
|
||||
@@ -186,7 +246,8 @@ public sealed class SettingsViewModelTests
|
||||
await s.Db.WriteAsync(async (c, tx, ct) =>
|
||||
{
|
||||
const string sql = "UPDATE games SET hook_blocked_reason = @block, hook_prescan_state = 'blocked', ac_exception_eligible = @eligible, "
|
||||
+ "ac_exception_verdict = @verdict, ac_exception_sessions = @sessions, ac_exception_checked_block = @block WHERE id = @id";
|
||||
+ "ac_exception_verdict = @verdict, ac_exception_sessions = @sessions, ac_exception_checked_block = @block, "
|
||||
+ "ac_exception_trial_failed_at = CASE WHEN @sessions = 1 THEN 1759449600000 END WHERE id = @id";
|
||||
const string yidun = "AntiCheatFile|NetEase Yidun|NEP2.dll";
|
||||
await Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(sql, new
|
||||
{
|
||||
@@ -224,9 +285,8 @@ public sealed class SettingsViewModelTests
|
||||
await pending;
|
||||
|
||||
(await h.Settings.GetBooleanAsync(SettingsRegistry.HookingUserModeExceptions, Ct)).Should().BeTrue();
|
||||
h.Vm.ExceptionGames.Select(static g => g.Name).Should().Equal("Few", "GF2");
|
||||
h.Vm.ExceptionGames.Single(static g => string.Equals(g.Name, "GF2", StringComparison.Ordinal)).CanGrant.Should().BeTrue();
|
||||
h.Vm.ExceptionGames.Single(static g => string.Equals(g.Name, "Few", StringComparison.Ordinal)).CanGrant.Should().BeFalse("one session is not the owner's two");
|
||||
h.Vm.ExceptionGames.Select(static g => g.Name).Should().Equal(["GF2"], "a row with no action is not listed");
|
||||
h.Vm.ExceptionGames.Single().CanGrant.Should().BeTrue();
|
||||
h.Vm.ExceptionsChecking.Should().BeFalse("the Agent answered about every blocked game");
|
||||
|
||||
await s.Db.WriteAsync((c, tx, ct) => Dapper.SqlMapper.ExecuteAsync(c, new Dapper.CommandDefinition(
|
||||
|
||||
@@ -126,7 +126,7 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
return ValueTask.FromResult(ConsentWriteOutcome.NotFound);
|
||||
}
|
||||
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(StoredBlock.Parse(block), v, sessions);
|
||||
bool eligible = verdict is { } v && UserModeExceptionRules.IsEligible(StoredBlock.Parse(block), v, row.AcException.TrialFailed);
|
||||
string? text = verdict is { } said ? $"{said.Reason}|{said.Family}|{said.Signal}" : null;
|
||||
Eligibility.Add((eligible, text, sessions));
|
||||
games.Rows[scanned.ExePath] = row with
|
||||
@@ -148,7 +148,8 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
public ValueTask<ConsentWriteOutcome> GrantAntiCheatExceptionAsync(AntiCheatExceptionGrantRequest grant, CancellationToken ct = default) =>
|
||||
throw new NotSupportedException("the sweep never grants");
|
||||
|
||||
public ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, CancellationToken ct = default)
|
||||
public ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, bool trialFailed = false,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
GameRow row = games.Rows[normalisedExePath];
|
||||
if (!row.AcException.IsGranted)
|
||||
@@ -160,7 +161,13 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
games.Rows[normalisedExePath] = row with
|
||||
{
|
||||
HookEnabled = row.HookBlockedReason is null && row.HookEnabled,
|
||||
AcException = row.AcException with { GrantedAt = null, LapsedReason = reason, LapsedAt = DateTimeOffset.UnixEpoch },
|
||||
AcException = row.AcException with
|
||||
{
|
||||
GrantedAt = null,
|
||||
LapsedReason = reason,
|
||||
LapsedAt = DateTimeOffset.UnixEpoch,
|
||||
TrialFailedAt = trialFailed ? row.AcException.TrialFailedAt ?? DateTimeOffset.UnixEpoch : row.AcException.TrialFailedAt,
|
||||
},
|
||||
};
|
||||
return ValueTask.FromResult(ConsentWriteOutcome.Written);
|
||||
}
|
||||
@@ -333,8 +340,11 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
|
||||
private static readonly AntiCheatVerdict _letThrough = AntiCheatVerdict.AllowedUnderException("NetEase Yidun", "NEP2.dll");
|
||||
|
||||
/// <summary>D33: a blocked entry, with the exception's evidence and option composed; optionally granted on the bytes on disk.</summary>
|
||||
private static async Task<Rig> BlockedAsync(string block = _yidun, int sessions = 3, bool granted = false, bool optionOn = true)
|
||||
/// <summary>
|
||||
/// D33: a blocked entry, with the exception's option composed; optionally granted on the bytes on disk with
|
||||
/// <paramref name="trial"/> successful sessions under the grant (D38), or marked as having failed a trial.
|
||||
/// </summary>
|
||||
private static async Task<Rig> BlockedAsync(string block = _yidun, int trial = 0, bool granted = false, bool optionOn = true, bool trialFailed = false)
|
||||
{
|
||||
var games = new FakeGameRepository();
|
||||
GameRow row = await games.EnsureAsync(new ExecutableFingerprint { ExePath = _exe, SizeBytes = 5, MtimeUnixMs = 5 }, "Title", Ct).ConfigureAwait(false);
|
||||
@@ -345,10 +355,12 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
HookEnabled = granted,
|
||||
AcException = granted
|
||||
? new AntiCheatExceptionState { GrantedAt = DateTimeOffset.UnixEpoch, Family = "NetEase Yidun", ExeSizeBytes = 5, ExeMtimeMs = 5 }
|
||||
: AntiCheatExceptionState.None,
|
||||
: trialFailed
|
||||
? AntiCheatExceptionState.None with { TrialFailedAt = DateTimeOffset.UnixEpoch, LapsedReason = UserModeExceptionLapse.TrialFailed }
|
||||
: AntiCheatExceptionState.None,
|
||||
};
|
||||
var rig = new Rig(games, exceptions: true);
|
||||
rig.Sessions.SuccessfulHooked[row.Id] = sessions;
|
||||
rig.Sessions.SuccessfulUnderGrant[row.Id] = trial;
|
||||
rig.Option.On = optionOn;
|
||||
rig.Guard.TolerantAnswer = _letThrough;
|
||||
return rig;
|
||||
@@ -356,8 +368,9 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): with the option on, a blocked entry is asked one question — a pre-scan NAMING its
|
||||
/// block's family — and eligible when the guard let exactly that family through and the evidence reaches two sessions.
|
||||
/// It is never scanned for a new block, and nothing is granted.
|
||||
/// block's family — and eligible when the guard let exactly that family through. D38 (2026-10-03): with no session at
|
||||
/// all — the GIRLS' FRONTLINE 2 shape on a fresh ledger, which D33's two sessions made unreachable. It is never scanned
|
||||
/// for a new block, and nothing is granted.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task WithTheOptionOnABlockedEntryIsAskedAboutItsExceptionAndNothingElse()
|
||||
@@ -371,7 +384,8 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
report.ExceptionsChecked.Should().Be(1);
|
||||
r.Guard.Tolerated.Should().Equal("NetEase Yidun");
|
||||
r.Consent.Writes.Should().BeEmpty("the pre-scan's own columns are not written over a block");
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((true, "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll", 3));
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((true, "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll", 0));
|
||||
r.Sessions.GrantCounts.Should().BeEmpty("no grant, no trial to count");
|
||||
r.Games.Rows[_exe].AcException.IsGranted.Should().BeFalse("eligibility grants nothing; the user does, through the disclosure");
|
||||
r.Games.Rows[_exe].HookBlockedReason.Should().Be(_yidun, "nothing clears a block");
|
||||
}
|
||||
@@ -386,28 +400,68 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
r.Consent.Eligibility.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The answer is keyed like the pre-scan: rules, executable and the block itself; the count is re-read every pass.</summary>
|
||||
/// <summary>
|
||||
/// The answer is keyed like the pre-scan: rules, executable and the block itself; D38: the trial of a grant in force is
|
||||
/// counted every pass, under that grant's family and time, and written when it moves.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task TheExceptionQuestionIsKeyedAndTheCountIsLive()
|
||||
public async Task TheExceptionQuestionIsKeyedAndTheTrialIsCountedLive()
|
||||
{
|
||||
using Rig r = await BlockedAsync(sessions: 1);
|
||||
using Rig r = await BlockedAsync(granted: true);
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Eligible.Should().BeFalse("one session is not the owner's two");
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((true, "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll", 0));
|
||||
r.Sessions.GrantCounts.Should().ContainSingle().Which.Should().Be((r.Games.Rows[_exe].Id, "NetEase Yidun", DateTimeOffset.UnixEpoch));
|
||||
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
r.Guard.Scanned.Should().ContainSingle("nothing in the key changed");
|
||||
r.Consent.Eligibility.Should().ContainSingle("and neither did the answer");
|
||||
|
||||
r.Sessions.SuccessfulHooked[r.Games.Rows[_exe].Id] = 2;
|
||||
r.Sessions.SuccessfulUnderGrant[r.Games.Rows[_exe].Id] = 1;
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
r.Guard.Scanned.Should().ContainSingle("a new session is counted, not scanned for");
|
||||
r.Consent.Eligibility[^1].Should().Be((true, "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll", 2));
|
||||
r.Guard.Scanned.Should().ContainSingle("a session under the grant is counted, not scanned for");
|
||||
r.Consent.Eligibility[^1].Should().Be((true, "AllowedUnderUserModeException|NetEase Yidun|NEP2.dll", 1));
|
||||
r.Games.Rows[_exe].AcException.IsGranted.Should().BeTrue("a count never ends a grant");
|
||||
|
||||
r.Rules.Version = "2026.09.6";
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
r.Guard.Scanned.Should().HaveCount(2, "new rules may have turned the family kernel-level");
|
||||
}
|
||||
|
||||
/// <summary>D38: a game an exception of which failed its trial is never eligible again, whatever the guard says.</summary>
|
||||
[Fact]
|
||||
public async Task AGameWhoseTrialFailedIsNeverEligibleAgain()
|
||||
{
|
||||
using Rig r = await BlockedAsync(trialFailed: true);
|
||||
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
|
||||
r.Guard.Tolerated.Should().Equal("NetEase Yidun");
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Eligible.Should().BeFalse("the trial's end was for good");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 2026-10-03: an executable the sweep cannot read is answered — the check could not run — instead of leaving the
|
||||
/// row "checking" for ever; once, and the first readable pass scans it.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AnUnreadableExecutableIsAnsweredNotLeftChecking()
|
||||
{
|
||||
using Rig r = await BlockedAsync();
|
||||
r.Identity.OnDisk = null;
|
||||
|
||||
(await r.Sweep.SweepOnceAsync(Ct)).ExceptionsChecked.Should().Be(1);
|
||||
(await r.Sweep.SweepOnceAsync(Ct)).ExceptionsChecked.Should().Be(0, "said once, not every pass");
|
||||
|
||||
r.Guard.Scanned.Should().BeEmpty("nothing could be read, so nothing was scanned");
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((false, "PreScanFailed||" + Path.GetFileName(_exe), 0));
|
||||
r.Games.Rows[_exe].AcException.CheckedBlock.Should().Be(_yidun, "the row is answered about its block, so the App stops saying it is checking");
|
||||
|
||||
r.Identity.OnDisk = new ExecutableFingerprint { ExePath = _exe, SizeBytes = 5, MtimeUnixMs = 5 };
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
r.Guard.Tolerated.Should().Equal("NetEase Yidun");
|
||||
r.Consent.Eligibility[^1].Eligible.Should().BeTrue("readable again, and asked again");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ATitleListBlockIsNeverAskedAndNeverEligible()
|
||||
{
|
||||
@@ -416,7 +470,7 @@ public sealed class AntiCheatPreScanSweepTests
|
||||
_ = await r.Sweep.SweepOnceAsync(Ct);
|
||||
|
||||
r.Guard.Scanned.Should().BeEmpty("the notorious titles are on the lists by design");
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((false, (string?)null, 3));
|
||||
r.Consent.Eligibility.Should().ContainSingle().Which.Should().Be((false, (string?)null, 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace FrameLedger.Application.Tests.AntiCheat;
|
||||
/// <summary>
|
||||
/// D33 (owner decision 2026-09-26): the managed half of the user-mode exception can only narrow. A family is named to the
|
||||
/// guard only when the option is on, a grant is on the row for these bytes, and the block is a module, file or folder
|
||||
/// finding of that family; a game is eligible only when the guard let exactly that family through and the evidence
|
||||
/// reaches the owner's two sessions.
|
||||
/// finding of that family; a game is eligible only when the guard let exactly that family through — D38 (2026-10-03):
|
||||
/// with no session needed, and never once an exception of the game failed its trial.
|
||||
/// </summary>
|
||||
public sealed class UserModeExceptionRulesTests
|
||||
{
|
||||
@@ -25,7 +25,7 @@ public sealed class UserModeExceptionRulesTests
|
||||
{
|
||||
Family = family,
|
||||
GrantedAt = DateTimeOffset.UnixEpoch,
|
||||
DisclosureVersion = "ac-exception-dialog/1",
|
||||
DisclosureVersion = "ac-exception-dialog/2",
|
||||
ExeSizeBytes = size,
|
||||
ExeMtimeUnixMs = mtime,
|
||||
};
|
||||
@@ -46,20 +46,30 @@ public sealed class UserModeExceptionRulesTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EligibleMeansTheGuardLetThatFamilyThroughAndTwoSessions()
|
||||
public void EligibleMeansTheGuardLetThatFamilyThroughAndNoTrialFailed()
|
||||
{
|
||||
StoredBlock? block = StoredBlock.Parse(_block);
|
||||
AntiCheatVerdict through = AntiCheatVerdict.AllowedUnderException("NetEase Yidun", "NEP2.dll");
|
||||
|
||||
UserModeExceptionRules.IsEligible(block, through, sessions: 2).Should().BeTrue();
|
||||
UserModeExceptionRules.IsEligible(block, through, sessions: 1).Should().BeFalse("the owner's threshold is two");
|
||||
UserModeExceptionRules.IsEligible(block, AntiCheatVerdict.Allowed(), sessions: 3).Should().BeFalse("a plain pass let nothing through, so it confirmed nothing");
|
||||
UserModeExceptionRules.IsEligible(block, AntiCheatVerdict.AllowedUnderException("Anybrain", "x.dll"), sessions: 3).Should().BeFalse();
|
||||
UserModeExceptionRules.IsEligible(block, through, trialFailed: false).Should().BeTrue("D38: no session is needed before a grant");
|
||||
UserModeExceptionRules.IsEligible(block, through, trialFailed: true).Should().BeFalse("an exception that failed its trial is never made again");
|
||||
UserModeExceptionRules.IsEligible(block, AntiCheatVerdict.Allowed(), trialFailed: false).Should().BeFalse("a plain pass let nothing through, so it confirmed nothing");
|
||||
UserModeExceptionRules.IsEligible(block, AntiCheatVerdict.AllowedUnderException("Anybrain", "x.dll"), trialFailed: false).Should().BeFalse();
|
||||
UserModeExceptionRules.IsEligible(block, AntiCheatVerdict.Refused(AntiCheatRefusalReason.AntiCheatFile, "Kernel driver in the game folder", "NEPKernel.sys"),
|
||||
sessions: 3).Should().BeFalse("the Aniimo shape");
|
||||
UserModeExceptionRules.IsEligible(StoredBlock.Parse("BlockedExecutable|Valve VAC|cs2.exe"), through, sessions: 3).Should().BeFalse();
|
||||
UserModeExceptionRules.IsEligible(null, through, sessions: 3).Should().BeFalse();
|
||||
UserModeExceptionRules.RequiredSessions.Should().Be(2);
|
||||
trialFailed: false).Should().BeFalse("the Aniimo shape");
|
||||
UserModeExceptionRules.IsEligible(StoredBlock.Parse("BlockedExecutable|Valve VAC|cs2.exe"), through, trialFailed: false).Should().BeFalse();
|
||||
UserModeExceptionRules.IsEligible(null, through, trialFailed: false).Should().BeFalse();
|
||||
}
|
||||
|
||||
/// <summary>D38: the owner's trial is two good sessions under the grant; until then it is a trial.</summary>
|
||||
[Fact]
|
||||
public void TheTrialIsTheGrantsFirstTwoGoodSessions()
|
||||
{
|
||||
UserModeExceptionRules.TrialSessions.Should().Be(2);
|
||||
UserModeExceptionRules.InTrial(0).Should().BeTrue();
|
||||
UserModeExceptionRules.InTrial(1).Should().BeTrue();
|
||||
UserModeExceptionRules.InTrial(2).Should().BeFalse();
|
||||
UserModeExceptionRules.InTrial(9).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -1186,8 +1186,7 @@ public sealed class CaptureSessionTests : IAsyncDisposable
|
||||
Fingerprint = Fingerprint,
|
||||
Block = _yidunBlock,
|
||||
Verdict = AntiCheatVerdict.AllowedUnderException("NetEase Yidun", "NEP2.dll"),
|
||||
Sessions = 3,
|
||||
DisclosureVersion = "ac-exception-dialog/1",
|
||||
DisclosureVersion = "ac-exception-dialog/2",
|
||||
GrantedAt = DateTimeOffset.UnixEpoch,
|
||||
}, ct).ConfigureAwait(false)).Should().Be(ConsentWriteOutcome.Written);
|
||||
(await store.RecordOperatorAcknowledgementAsync(new OperatorAcknowledgement
|
||||
|
||||
@@ -183,7 +183,7 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
var handler = new AgentCommandHandler(games, consent, guard, identity, orchestrator, pause, lifetime,
|
||||
_ => { h.RulesUpdates++; return ValueTask.FromResult("AlreadyCurrent"); },
|
||||
disclosureVersion, new FakeClock(), sweepRetention: sweep, architecture: architecture,
|
||||
exceptions: exceptions ? new AntiCheatExceptionCommands(option, sessions, _exceptionDisclosure) : null);
|
||||
exceptions: exceptions ? new AntiCheatExceptionCommands(option, _exceptionDisclosure) : null, deleteSessions: sessions);
|
||||
h = new Harness
|
||||
{
|
||||
Handler = handler,
|
||||
@@ -438,6 +438,47 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
payload.Reason.Should().NotBeNullOrEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// beta.11 (owner decision D40): DeleteSessions deletes the Agent's own rows — one game's, or every game's — and answers
|
||||
/// the counts; a request with no payload is malformed; and nothing runs here, so nothing is refused for a recording.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task DeleteSessionsDeletesTheAgentsRowsAndAnswersTheCounts()
|
||||
{
|
||||
Harness h = await BuildAsync().ConfigureAwait(true);
|
||||
long game = h.Games.Rows[_exe].Id;
|
||||
foreach (long owner in new[] { game, game, game + 1 })
|
||||
{
|
||||
h.Sessions.Stored.Add(new FinalizedSession
|
||||
{
|
||||
Row = new SessionRow
|
||||
{
|
||||
SessionGuid = Guid.NewGuid(),
|
||||
GameId = owner,
|
||||
SnapshotId = 1,
|
||||
StartedAt = DateTimeOffset.UnixEpoch,
|
||||
EndedAt = DateTimeOffset.UnixEpoch.AddMinutes(1),
|
||||
QpcEpoch = 0,
|
||||
QpcFrequency = 1,
|
||||
Tier = Domain.Sessions.CaptureTier.Hooked,
|
||||
Mode = Domain.Sessions.CaptureMode.Attach,
|
||||
ExitStatus = Domain.Sessions.ExitStatus.Normal,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
IpcEnvelope one = await AskAsync(h.Handler, IpcMessageType.DeleteSessions, new DeleteSessionsRequest(game)).ConfigureAwait(true);
|
||||
IpcCodec.Payload<DeleteSessionsAck>(one).Should().Be(new DeleteSessionsAck(game, 1, 2));
|
||||
h.Sessions.Stored.Should().ContainSingle().Which.Row.GameId.Should().Be(game + 1);
|
||||
|
||||
IpcEnvelope all = await AskAsync(h.Handler, IpcMessageType.DeleteSessions, new DeleteSessionsRequest(null)).ConfigureAwait(true);
|
||||
IpcCodec.Payload<DeleteSessionsAck>(all).Should().Be(new DeleteSessionsAck(null, 1, 1));
|
||||
h.Sessions.Stored.Should().BeEmpty();
|
||||
|
||||
IpcEnvelope malformed = await AskAsync(h.Handler, IpcMessageType.DeleteSessions).ConfigureAwait(true);
|
||||
IpcCodec.Payload<ErrorAck>(malformed)!.Code.Should().Be(IpcErrorCode.Malformed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LaunchGameIsTheOrchestratorsAnswer()
|
||||
{
|
||||
@@ -486,20 +527,28 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
Encoding.UTF8.GetString(IpcCodec.Encode(IpcMessageType.Ping, "9")).Should().NotContain("payload");
|
||||
}
|
||||
|
||||
private const string _exceptionDisclosure = "ac-exception-dialog/1";
|
||||
private const string _exceptionDisclosure = "ac-exception-dialog/2";
|
||||
|
||||
private const string _yidunBlock = "AntiCheatFile|NetEase Yidun|NEP2.dll";
|
||||
|
||||
/// <summary>D33: the owner's GIRLS' FRONTLINE 2 as beta.8 left it — consented, then blocked for NetEase Yidun — on both views of the row.</summary>
|
||||
private async Task<Harness> BlockedAsync(int sessions = 3, string block = _yidunBlock, string? disclosureVersion = null)
|
||||
/// <summary>
|
||||
/// D33: the owner's GIRLS' FRONTLINE 2 as beta.8 left it — consented, then blocked for NetEase Yidun — on both views of the
|
||||
/// row, with no session at all (D38: the shape a fresh ledger has); optionally marked as having failed an earlier trial.
|
||||
/// </summary>
|
||||
private async Task<Harness> BlockedAsync(string block = _yidunBlock, string? disclosureVersion = null, bool trialFailed = false)
|
||||
{
|
||||
Harness h = await BuildAsync(disclosureVersion: disclosureVersion, exceptions: true).ConfigureAwait(false);
|
||||
StoredBlock parsed = StoredBlock.Parse(block)!.Value;
|
||||
await h.Consent.RecordGuardBlockAsync(h.Identity.Read(_exe)!.Value, AntiCheatVerdict.Refused(parsed.Reason, parsed.Family, parsed.Signal), Ct)
|
||||
.ConfigureAwait(false);
|
||||
GameRow row = h.Games.Rows[_exe];
|
||||
h.Games.Rows[_exe] = row with { HookBlockedReason = block, HookPrescanState = "blocked", HookEnabled = false };
|
||||
h.Sessions.SuccessfulHooked[row.Id] = sessions;
|
||||
h.Games.Rows[_exe] = row with
|
||||
{
|
||||
HookBlockedReason = block,
|
||||
HookPrescanState = "blocked",
|
||||
HookEnabled = false,
|
||||
AcException = trialFailed ? row.AcException with { TrialFailedAt = DateTimeOffset.FromUnixTimeMilliseconds(1_759_449_600_000) } : row.AcException,
|
||||
};
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -526,7 +575,10 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
(await h.Consent.FindAsync(_exe, Ct).ConfigureAwait(true)).Exception.Should().BeNull();
|
||||
}
|
||||
|
||||
/// <summary>The facts are the Agent's own — a tolerant pre-scan of the file on disk, the session count — and a grant turns nothing on.</summary>
|
||||
/// <summary>
|
||||
/// The facts are the Agent's own — a tolerant pre-scan of the file on disk — and a grant turns nothing on. D38: the row has
|
||||
/// no session at all, and the grant is made: its first two sessions are its trial.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AGrantRestsOnFactsTheAgentGathersAndTurnsNothingOn()
|
||||
{
|
||||
@@ -546,15 +598,18 @@ public sealed class AgentCommandHandlerTests : IAsyncDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TooFewSessionsATitleListOrAGuardThatLetsNothingThroughIsRefused()
|
||||
public async Task AFailedTrialOrAGuardThatLetsNothingThroughIsRefused()
|
||||
{
|
||||
Harness one = await BlockedAsync(sessions: 1).ConfigureAwait(true);
|
||||
IpcEnvelope few = await AskAsync(one.Handler, IpcMessageType.SetAntiCheatException, Grant(one)).ConfigureAwait(true);
|
||||
few.Type.Should().Be(IpcMessageType.Refused);
|
||||
IpcCodec.Payload<RefusedAck>(few).Should().Be(new RefusedAck(one.Games.Rows[_exe].Id, AgentCommandHandler.TooFewSessionsReason, "NetEase Yidun", "1"));
|
||||
// D38: an exception of this game ended during its trial — for good, and before anything is scanned.
|
||||
Harness failed = await BlockedAsync(trialFailed: true).ConfigureAwait(true);
|
||||
IpcEnvelope again = await AskAsync(failed.Handler, IpcMessageType.SetAntiCheatException, Grant(failed)).ConfigureAwait(true);
|
||||
again.Type.Should().Be(IpcMessageType.Refused);
|
||||
IpcCodec.Payload<RefusedAck>(again).Should().Be(new RefusedAck(failed.Games.Rows[_exe].Id, AgentCommandHandler.TrialFailedReason, "NetEase Yidun",
|
||||
"1759449600000"));
|
||||
failed.Guard.Scanned.Should().BeEmpty();
|
||||
|
||||
Harness one = await BlockedAsync().ConfigureAwait(true);
|
||||
one.Guard.TolerantPreScan = AntiCheatVerdict.Refused(AntiCheatRefusalReason.AntiCheatFile, "Kernel driver in the game folder", "NEPKernel.sys");
|
||||
one.Sessions.SuccessfulHooked[one.Games.Rows[_exe].Id] = 3;
|
||||
RefusedAck driver = IpcCodec.Payload<RefusedAck>(await AskAsync(one.Handler, IpcMessageType.SetAntiCheatException, Grant(one)).ConfigureAwait(true))!;
|
||||
driver.Reason.Should().Be(nameof(AntiCheatRefusalReason.AntiCheatFile), "the Aniimo shape: D30 is never excepted");
|
||||
driver.Signal.Should().Be("NEPKernel.sys");
|
||||
|
||||
@@ -91,11 +91,33 @@ internal sealed class FakeSessionRepository : ISessionRepository
|
||||
public ValueTask<long> CountSinceAsync(DateTimeOffset since, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult((long)Stored.Count(s => s.Row.StartedAt >= since));
|
||||
|
||||
/// <summary>D33: each game's successful Tier-1 sessions, as the tests say; a game not named has none.</summary>
|
||||
public Dictionary<long, int> SuccessfulHooked { get; } = [];
|
||||
/// <summary>beta.11 (D40): every session of the game, or of every game, leaves the store.</summary>
|
||||
public ValueTask<RetentionSweepResult> DeleteSessionsAsync(long? gameId, CancellationToken ct = default)
|
||||
{
|
||||
List<FinalizedSession> gone = [.. Stored.Where(s => gameId is null || s.Row.GameId == gameId)];
|
||||
int games = gone.Select(static s => s.Row.GameId).Distinct().Count();
|
||||
foreach (FinalizedSession session in gone)
|
||||
{
|
||||
Stored.Remove(session);
|
||||
}
|
||||
|
||||
public ValueTask<int> CountSuccessfulHookedAsync(long gameId, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult(SuccessfulHooked.GetValueOrDefault(gameId));
|
||||
return ValueTask.FromResult(new RetentionSweepResult(games, gone.Count));
|
||||
}
|
||||
|
||||
/// <summary>D38: each game's successful sessions under its grant in force, as the tests say; a game not named has none.</summary>
|
||||
public Dictionary<long, int> SuccessfulUnderGrant { get; } = [];
|
||||
|
||||
/// <summary>D38: the count for a game the dictionary does not name (the recorder's own row ids are not the test's).</summary>
|
||||
public int UnderGrantDefault { get; set; }
|
||||
|
||||
/// <summary>D38: every count asked for, in order — the family and grant time it was asked about.</summary>
|
||||
public List<(long GameId, string Family, DateTimeOffset GrantedAt)> GrantCounts { get; } = [];
|
||||
|
||||
public ValueTask<int> CountSuccessfulUnderGrantAsync(long gameId, string family, DateTimeOffset grantedAt, CancellationToken ct = default)
|
||||
{
|
||||
GrantCounts.Add((gameId, family, grantedAt));
|
||||
return ValueTask.FromResult(SuccessfulUnderGrant.GetValueOrDefault(gameId, UnderGrantDefault));
|
||||
}
|
||||
|
||||
public ValueTask<IReadOnlyList<SegmentRow>> FindSegmentsAsync(long sessionId, CancellationToken ct = default) =>
|
||||
ValueTask.FromResult(sessionId >= 1 && sessionId <= Stored.Count ? Stored[(int)sessionId - 1].Segments : []);
|
||||
|
||||
@@ -297,7 +297,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
new SessionFinalizer(sessions, new RawSeriesCodec()), new NoCrashEvents(),
|
||||
_ => poller ? new FakePoller(clockStepsOnDrain ? clock : null) : null, clock,
|
||||
new RecorderOptions { PartialFlushInterval = TimeSpan.FromSeconds(10) }, profiles: profiles,
|
||||
exceptionLapse: new UserModeExceptionLapsePolicy(store));
|
||||
exceptionLapse: new UserModeExceptionLapsePolicy(store, sessions));
|
||||
return new Harness { Recorder = recorder, Games = games, Sessions = sessions, Partials = partials, Clock = clock, Store = store };
|
||||
}
|
||||
|
||||
@@ -312,8 +312,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
Fingerprint = Fingerprint,
|
||||
Block = "AntiCheatFile|NetEase Yidun|NEP2.dll",
|
||||
Verdict = AntiCheatVerdict.AllowedUnderException("NetEase Yidun", "NEP2.dll"),
|
||||
Sessions = 2,
|
||||
DisclosureVersion = "ac-exception-dialog/1",
|
||||
DisclosureVersion = "ac-exception-dialog/2",
|
||||
GrantedAt = DateTimeOffset.UnixEpoch,
|
||||
}, ct).ConfigureAwait(false);
|
||||
await store.RecordOperatorAcknowledgementAsync(new OperatorAcknowledgement
|
||||
@@ -367,6 +366,32 @@ public sealed class SessionRecorderTests : IAsyncDisposable
|
||||
after.HookEnabled.Should().BeFalse("the block stands, so hooking goes off with the exception");
|
||||
after.BlockedReason.Should().Be("AntiCheatFile|NetEase Yidun|NEP2.dll", "nothing clears a block");
|
||||
after.ConsentedAt.Should().NotBeNull("the end of an exception keeps the consent stamp, as a block does");
|
||||
GameRow row = (await new SqliteGameRepository(_db!).FindAsync(_exe, TestContext.Current.CancellationToken))!;
|
||||
row.AcException.TrialFailed.Should().BeTrue("D38: the grant had no good session yet, so a crash ends it for good");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// D38 (owner decision 2026-10-03): during the trial a stored hooked session that recorded no frame ends the exception for
|
||||
/// good; past the trial (two good sessions under the grant) the same session leaves it in force.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData(0, true)]
|
||||
[InlineData(1, true)]
|
||||
[InlineData(2, false)]
|
||||
public async Task ASessionThatRecordedNothingEndsTheExceptionOnlyDuringItsTrial(int goodSoFar, bool ends)
|
||||
{
|
||||
Harness h = await MakeAsync(verdict: AntiCheatVerdict.AllowedUnderException("NetEase Yidun", "NEP2.dll"), excepted: true, records: 0);
|
||||
h.Sessions.UnderGrantDefault = goodSoFar;
|
||||
|
||||
RecordedSession r = await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
|
||||
|
||||
r.Row.Tier.Should().Be(CaptureTier.Hooked);
|
||||
r.Row.FrameCount.Should().Be(0);
|
||||
r.Finalize.Status.Should().Be(FinalizeStatus.Saved, "only a stored session is judged");
|
||||
r.ExceptionLapse.Should().Be(ends ? UserModeExceptionLapse.TrialFailed : null);
|
||||
GameRow after = (await new SqliteGameRepository(_db!).FindAsync(_exe, TestContext.Current.CancellationToken))!;
|
||||
after.AcException.IsGranted.Should().Be(!ends);
|
||||
after.AcException.TrialFailed.Should().Be(ends);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -9,7 +9,8 @@ namespace FrameLedger.Application.Tests.Recording;
|
||||
|
||||
/// <summary>
|
||||
/// D33: which ends of a session under a game's user-mode exception end the exception — a finding about the game, a safety
|
||||
/// unhook, the Overlay's own stop, a crash while hooked — and that nothing else does.
|
||||
/// unhook, the Overlay's own stop, a crash while hooked — and that nothing else does; D38: during the grant's trial, a
|
||||
/// stored hooked session that recorded no frame or did not end normally ends it too.
|
||||
/// </summary>
|
||||
public sealed class UserModeExceptionLapsePolicyTests
|
||||
{
|
||||
@@ -42,4 +43,39 @@ public sealed class UserModeExceptionLapsePolicyTests
|
||||
[Fact]
|
||||
public void ASessionUnderNoExceptionIsNeverTheExceptionsBusiness() =>
|
||||
UserModeExceptionLapsePolicy.LapseOf(Under(SessionEndReason.SafetyUnhook, turnedOff: true, family: null), ExitStatus.UnhookedSafety).Should().BeNull();
|
||||
|
||||
private static readonly SessionForTrial _stored = new(GameId: 7, StoredHooked: true, FrameCount: 5_000);
|
||||
|
||||
[Theory]
|
||||
[InlineData(ExitStatus.Normal, 0L)]
|
||||
[InlineData(ExitStatus.Degraded, 5_000L)]
|
||||
[InlineData(ExitStatus.Interrupted, 5_000L)]
|
||||
public void DuringTheTrialAStoredSessionThatDidNotSucceedEndsIt(ExitStatus exit, long frames) =>
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), exit, _stored with { FrameCount = frames }, inTrial: true)
|
||||
.Should().Be(UserModeExceptionLapse.TrialFailed);
|
||||
|
||||
[Fact]
|
||||
public void ASucceededSessionOrOneNotStoredOrOnePastTheTrialIsNotATrialFailure()
|
||||
{
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Normal, _stored, inTrial: true).Should().BeNull("it succeeded");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Normal, _stored with { StoredHooked = false, FrameCount = 0 }, inTrial: true)
|
||||
.Should().BeNull("a session too short to keep proves nothing either way");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Normal, _stored with { FrameCount = 0 }, inTrial: false)
|
||||
.Should().BeNull("past the trial only the D33 ends end it");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited, family: null), ExitStatus.Normal, _stored with { FrameCount = 0 }, inTrial: true)
|
||||
.Should().BeNull("a session under no exception is never the exception's business");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Crashed, _stored, inTrial: true)
|
||||
.Should().Be(UserModeExceptionLapse.SessionCrashed, "a more specific reason is said as itself, and still marks the trial failed");
|
||||
UserModeExceptionLapsePolicy.EndOf(Under(SessionEndReason.TargetExited), ExitStatus.Crashed, _stored with { StoredHooked = false, FrameCount = 0 }, inTrial: true)
|
||||
.Should().Be(UserModeExceptionLapse.SessionCrashed, "a session too short to keep is not judged by its frames, but a crash while hooked still ends it");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SucceededIsTheTrialCountsRule()
|
||||
{
|
||||
UserModeExceptionLapsePolicy.Succeeded(_stored, ExitStatus.Normal).Should().BeTrue();
|
||||
UserModeExceptionLapsePolicy.Succeeded(_stored, ExitStatus.Crashed).Should().BeFalse();
|
||||
UserModeExceptionLapsePolicy.Succeeded(_stored with { FrameCount = 0 }, ExitStatus.Normal).Should().BeFalse();
|
||||
UserModeExceptionLapsePolicy.Succeeded(_stored with { StoredHooked = false }, ExitStatus.Normal).Should().BeFalse();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,8 @@ public sealed class VkLayerReconcilerTests
|
||||
public ValueTask<ConsentWriteOutcome> GrantAntiCheatExceptionAsync(AntiCheatExceptionGrantRequest grant, CancellationToken ct = default) =>
|
||||
throw new NotSupportedException();
|
||||
|
||||
public ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, CancellationToken ct = default) =>
|
||||
public ValueTask<ConsentWriteOutcome> RevokeAntiCheatExceptionAsync(string normalisedExePath, string reason, bool trialFailed = false,
|
||||
CancellationToken ct = default) =>
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
|
||||
@@ -432,6 +432,7 @@ public sealed class CaptureOrchestratorTests
|
||||
|
||||
recorder.Requests.Should().ContainSingle("one session per executable, whatever id its entry has now");
|
||||
o.IsRecording(original.Id).Should().BeTrue();
|
||||
o.IsRecordingAny().Should().BeTrue("beta.11: what deleting every session waits for");
|
||||
log.Should().Contain(l => l.Contains("one at a time", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
|
||||
@@ -134,6 +134,43 @@ public sealed class LedgerDatabaseTests
|
||||
cancellationToken: Ct)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Schema 0017 (2026-10-03, beta.11, D38): <c>games.ac_exception_trial_failed_at</c>, NULL on every row written before — a
|
||||
/// grant made under D33 keeps everything it had and carries no failed trial.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task ScriptSeventeenAddsTheTrialMarkAndChangesNoRow()
|
||||
{
|
||||
await using LedgerFixture f = await LedgerFixture.OpenAsync();
|
||||
MigrationRunner.LatestVersion.Should().BeGreaterThanOrEqualTo(17);
|
||||
string path = f.Path;
|
||||
await f.Db.DisposeAsync().ConfigureAwait(true);
|
||||
var c16 = new SqliteConnection(new SqliteConnectionStringBuilder { DataSource = path, Pooling = false }.ToString());
|
||||
await using (c16.ConfigureAwait(true))
|
||||
{
|
||||
await c16.OpenAsync(Ct).ConfigureAwait(true);
|
||||
await RewindToAsync(c16, 16).ConfigureAwait(true);
|
||||
await c16.ExecuteAsync(new CommandDefinition(
|
||||
"INSERT INTO games (name, exe_path, hook_blocked_reason, hook_prescan_state, ac_exception_at, ac_exception_family, ac_exception_sessions, "
|
||||
+ "added_at, updated_at) VALUES ('GF2', 'C:\\GF2\\GF2_Exilium.exe', 'AntiCheatFile|NetEase Yidun|NEP2.dll', 'blocked', 1000, 'NetEase Yidun', 3, 0, 0)",
|
||||
cancellationToken: Ct)).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
LedgerDatabase migrated = await LedgerDatabase.OpenAsync(path, ct: Ct).ConfigureAwait(true);
|
||||
await using (migrated.ConfigureAwait(true))
|
||||
{
|
||||
migrated.SchemaVersion.Should().Be(MigrationRunner.LatestVersion);
|
||||
long columns = await migrated.ReadAsync((c, ct) => c.ExecuteScalarAsync<long>(new CommandDefinition(
|
||||
"SELECT COUNT(*) FROM pragma_table_info('games') WHERE name = 'ac_exception_trial_failed_at'", cancellationToken: ct)), Ct).ConfigureAwait(true);
|
||||
columns.Should().Be(1);
|
||||
|
||||
GameRow row = (await new SqliteGameRepository(migrated).FindAsync(@"C:\GF2\GF2_Exilium.exe", Ct).ConfigureAwait(true))!;
|
||||
row.AcException.IsGranted.Should().BeTrue("0017 edits no row: a D33 grant stays in force");
|
||||
row.AcException.Sessions.Should().Be(3);
|
||||
row.AcException.TrialFailedAt.Should().BeNull();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Schema 0016 (2026-09-27, beta.10): the display mode's fifteen columns, ADD COLUMN only — a session written before it
|
||||
/// has none of them (N/A, never a zero), and a new one writes and reads each.
|
||||
@@ -251,7 +288,7 @@ public sealed class LedgerDatabaseTests
|
||||
IReadOnlyList<string> games = await migrated.ReadAsync(async (c, ct) =>
|
||||
(IReadOnlyList<string>)[.. await c.QueryAsync<string>(new CommandDefinition(
|
||||
"SELECT name FROM pragma_table_info('games') WHERE name LIKE 'ac_exception_%'", cancellationToken: ct)).ConfigureAwait(false)], Ct).ConfigureAwait(true);
|
||||
games.Should().HaveCount(14);
|
||||
games.Should().HaveCount(15, "0014's fourteen, and since 0017 the trial mark");
|
||||
long sessions = await migrated.ReadAsync((c, ct) => c.ExecuteScalarAsync<long>(new CommandDefinition(
|
||||
"SELECT COUNT(*) FROM pragma_table_info('sessions') WHERE name = 'ac_exception_family'", cancellationToken: ct)), Ct).ConfigureAwait(true);
|
||||
sessions.Should().Be(1);
|
||||
|
||||
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user