Add Support for Gecko Codes to Achievements Whitelist
This PR sets up the Achievements whitelist for patches to also support Gecko codes.
I recommend also supporting Action Replay codes.
I can add that as well, but thought one step at a time, and the requests have overwhelmingly been for Gecko next.
Okay, I suppose we can do one at a time.
The message "Failed to verify patch {} from file {}." currently mentions patches specifically. It should either mention the specific type of code (i.e. Gecko code or patch), or it could say just "code" instead of "patch".
Smoke-tested?
In particular, please test if there is any way to cause this to discard 'unapproved' codes from the user's local game INI. It's unclear to me whether that is possible from the code.
I missed something in my review: The unit test (PatchAllowlistTest.cpp) is still only checking patches, not Gecko codes.
Decided to add a couple things anyways so I'm drafting this until it's ready.
In particular, please test if there is any way to cause this to discard 'unapproved' codes from the user's local game INI. It's unclear to me whether that is possible from the code.
I'm not entirely certain I follow what you mean here @AdmiralCurtiss , I'm not aware of anything that causes codes to be removed from the INI files but I don't know what I don't know. I'm definitely not calling it on purpose; the functionality should simply be filtering out active codes. I think.
What I mean is, this seems like a perfectly plausible code path that I'm not sure how you're preventing:
GeckoCodeWidget constructor
calls GeckoCodeWidget::LoadCodes()
calls Gecko::LoadCodes(game_ini_default, game_ini_local)
filters codes, removes any unapproved
filtered codes are stored in m_gecko_codes
later:
GeckoCodeWidget::SaveCodes() is called for any reason
calls Gecko::SaveCodes(game_ini_local, m_gecko_codes) with the filtered codes
calls inifile.SetLines("Gecko", lines) with filtered codes
overwrites any pre-existing codes in the ini
saves modified ini without the unapproved codes to disk
While I'm looking into other questions brought up by this investigation, I can tell you that it appears that no code path within Dolphin is modifying ini files from the Sys folder, aka codes from the repo. What to do with user codes is a different question I'm evaluating in the Discord server currently.
The description of the last commit mentions "a strange compatibility bug with creator name on Gecko codes". Could you explain why this means you should allowlist the SSL patch for the Nintendo Channel?
Also, have you checked what happens if you use netplay code syncing when the person hosting isn't using hardcore mode but the person joining is?
To be explicit about the current review status: What remains is a concept for how netplay code syncing should be handled.
At least the first step of a Netplay solution is here: https://github.com/dolphin-emu/dolphin/pull/13153