fix(app): game detection finds Battle.net games where they are installed and takes any letters in a path

- Battle.net installs anywhere: its games come from the machine's uninstall entries (removed by
  its Blizzard Uninstaller or published by Blizzard Entertainment, with an install folder, not
  Battle.net itself), read when the watch starts; a program inside one is a game named after
  the entry
- launcher folders are matched part by part with ASCII case ignored; the name was cut by byte
  positions of a lower-cased copy, which panicked the detection thread on a path such as
  D:\İ\steamapps\common\하데스\game.exe
- checked on the win-ci VM: a Steam game under a non-ASCII path and a Battle.net game (test
  uninstall entry) turn game mode on with their names and off when they end

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 09:32:53 +09:00
parent c9101e0d6a
commit 7e83b09dd5
5 changed files with 192 additions and 51 deletions

View File

@@ -338,14 +338,19 @@ elsewhere it never sees a game). It never looks at the game's screen.
most 100 names, no folders. Read when the services start.
- The foreground program is a game, in this order: in `notGames`: no; in `games`: yes
(`registered`); a browser (also the bot's Chrome), video player, the desktop, Discord, a
launcher's own window or this app: no; under a launcher's game folder (`\steamapps\common\`,
`\epic games\`, `\riot games\`, `\battle.net\`): yes (`launcher`, with the launcher's name);
launcher's own window or this app: no; under a launcher's game folder (the folder after
`steamapps\common`, `Epic Games` or `Riot Games`) or inside a Battle.net game's install folder:
yes (`launcher`, with the launcher's name). Battle.net installs anywhere, so its games come from
the machine's uninstall entries (64- and 32-bit), read when the watch starts: entries removed by
its "Blizzard Uninstaller" or published by Blizzard Entertainment, with an install folder, not
Battle.net itself. Paths are compared part by part (folder names, ASCII case ignored), never cut by
byte positions, so any letters in a path are fine;
Windows reports a full-screen Direct3D program (`fullscreen`): yes; its window covers one monitor
completely, has no title bar or sizing border, and its process uses at least 10% of the GPU's 3D
engine (`borderless`, the M0 check's rule): yes.
- Once seen, game mode stays until that game's process ends, also while another window is in
front; with `detect` off it is off. The name is the game's folder under the launcher folder, else
the program's name without ".exe". The `game` log tab gets "game mode on: name (reason)" and
the program's name without ".exe" (a Battle.net game: its uninstall entry's name). The `game` log tab gets "game mode on: name (reason)" and
"game mode off".
## LLM (`app/src/strata.rs`)
@@ -540,10 +545,12 @@ settings folder and the next install giving one working device, the monitor off
while the bot browser runs and off after, one Chrome window there filling the work area and holding
the bot's tab, the focus staying in the program the user types into, no taskbar button, no Chrome
left after the stop, and the uninstall leaving no device, driver package, registry key or settings
folder. Game detection (`tests/game_watch.rs`): a program started from a Steam game folder turns
game mode on with the folder's name and off once it ends. On every system: game detection's rules
folder. Game detection (`tests/game_watch.rs`): a program started from a Steam game folder (also under
a path with non-ASCII letters) or from a Battle.net game's install folder (a test uninstall entry)
turns game mode on with its name and off once it ends. On every system: game detection's rules
(a borderless game, a maximised program, a browser's full-screen video, exclusive full screen,
launcher folders and their own windows, the person's lists first, staying on until the game ends,
launcher folders and their own windows, Battle.net games by install folder and their uninstall
entries, non-ASCII paths, the person's lists first, staying on until the game ends,
detection off) and its settings. A removal forgets the driver only when no device is left and the package
is gone or was not in the store; a failed install forgets it only under the same rule (and never
when it was ours before), reporting both reasons otherwise; a leftover offers removal; driver tasks refused while the services start, and a start (and a