Steam app id detection that matches what Steam writes #43
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ethan-hann/SavePoint!43
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-39-steam-app-id-detection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #39. Stacked on #42 (its first three commits are #42's); merge #42 first.
Checked against the real Steam install on one PC first (174 installed games, libraries on three drives):
Changes:
Real games before and after: the detected id equals the manifest id for 170 of 174 installed games before and 172 after; for the files alone (as if copied outside a library) 10 of 38 before and 34 of 38 after.
Real data first (read only; Steam on C:, D:, X:; N: offline): 174 installed games, each with an appmanifest naming its install folder. 38 keep a steam_appid.txt somewhere (136 keep none). 25 have it in the install folder: 13 end in LF + NUL (0A 00), 1 ends in space + CRLF (20 0D 0A), 11 are bare digits. 13 more keep it only in a subfolder, found at: Binaries/Win32, Binaries/Win64, Binaries, Build/Final, x64, bin, Launcher, Classic, Online/Binaries/Win32, and SteamVR's tools/steamvr_environments/game/bin/win64 (5 deep, a tool, not a game). Nine of the ten usable subfolders are 1 to 2 deep, the deepest game case is 3. Three root files name an app other than the manifest: Mafia III 398870 (manifest 360430), House Flipper 1471280 (613100), Fallout 4 GOTY 377160 (1946160, shares a folder with 377160). House Flipper's subfolder copies say 480. Changes: inside a library the manifest's id now wins and steam_appid.txt is the fallback; the file parser trims whitespace and NUL bytes (and nothing else) around the digits; with no file in the install folder, up to 3 levels of subfolders are searched breadth first in name order, at most 200 folders, never through a link; SteamCdn accepts image/png and image/webp as well as image/jpeg (ImageProbe still has to decode the bytes) and says so in its Accept header. Observed reds (all assertion failures): file with "377160\n\0", "489830\0", "\0\0 489830 \n\0\0" returned null instead of the id; eight subfolder shapes (Binaries/Win32, Binaries/Win64, Binaries, Build/Final, x64, bin, Launcher, Online/Binaries/Win32) returned null; the Mafia III shape returned 398870 instead of 360430; a file in the install folder beat the manifest; the three-level stop, shallower-wins and root-beats-subfolder tests failed on null or the wrong id; PNG and WebP answers came back Failed instead of Found; the Accept header lacked image/png and image/webp. Mutation checks for tests that passed first run: removing ReparsePoint from the skipped attributes fails the symbolic-link test; raising the folder budget to 2000 fails the many-subfolders test; replacing the trim with Replace("\0","").Trim() fails the "48<NUL>9830" case; making the image probe always succeed fails the PNG/WebP-over-HTML test and the two existing not-an-image tests. Real installed games, detector id equal to the manifest id: in place 170 before, 172 after of 174 (the other two share an install folder with a lower-numbered app, so only the lowest id can match); copies holding only the steam_appid.txt files outside any library 10 before, 34 after of 38 (the four left: SteamVR is 5 folders deep, and Mafia III, House Flipper and Fallout 4 GOTY carry another app's id).