Skip to content

Claude/game profile path lookup d5du24 - #92

Merged
jmquigs merged 2 commits into
masterfrom
claude/game-profile-path-lookup-d5du24
Sep 9, 2026
Merged

jmquigs merged 2 commits into
masterfrom
claude/game-profile-path-lookup-d5du24

Conversation

@jmquigs

@jmquigs jmquigs commented Sep 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits August 25, 2026 19:17
Authored by Claude (claude-opus-5)

A profile was located by an exact match on its ExePath registry value.  Under
steam/proton the same install is reachable through several drive mappings
(Z:\ for the unix root, a steam library drive, plus any hand-made mapping), so
one exact ExePath can't cover them and the workaround was a duplicate profile
per path.

Both the native and managed lookups now fall back to a component-wise suffix
match: an exact match still wins outright, otherwise the profile sharing the
most trailing path components wins, provided it shares at least two (file name
plus one parent dir).  Requiring two rules out the case where an unrelated
profile is picked up purely because its game happens to ship a generically
named exe.  Ties are broken by registry order and logged, since they generally
mean there are leftover duplicate profiles.  Splitting on components also makes
the match insensitive to separator style and the \\?\ prefix.

Both sides had to change together: native resolves the profile at device
creation (before the CLR loads) while managed resolves it again in
RegConfig.load, and the managed result is handed back to native as
ConfData.ProfileKey.  Changing only native left snapshots unable to find the
profile.

The scoring is split out of the registry I/O on both sides
(util::game_profile::pick_best_profile, RegConfig.pickBestProfile) so it can be
unit tested; the two test tables mirror each other.

RegConfig.findProfilePath stays an exact match: saveProfile falls back to it
when the profile key name is empty, and MMLaunch uses it to reject an exe that
another profile already claims.  A relaxed match there would let creating a
profile silently take over an existing one.

No interop wire change, so no native code version bump.
Authored by Claude (claude-opus-5)

The F# note said a linux container probably couldn't build this code.  It can:
the ubuntu 24.04 dotnet-sdk-8.0 package builds the *.dotnet.fsproj variants, and
mono plus NUnit's console runner runs the tests.

Records the parts that aren't obvious: paket's restore target shells out to mono
and fails the build before the compiler runs (-p:PaketRestoreDisabled=True), the
packages/ HintPath deps have to be fetched from nuget by hand, dotnet test can't
run net462 because the distro SDK ships no test host for it, FSharp.Core isn't
copied to the output dir, and 6 tests fail on linux for unrelated reasons
(Util.TestDataDir searches windows-style relative paths).
@jmquigs
jmquigs merged commit 4873f56 into master Sep 9, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants