Claude/game profile path lookup d5du24 - #92
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.