This makes us savestate the NAND using the same APIs the guest uses
instead of directly touching the host files. This solves several
problems:
* If the user loaded a malicious savestate, it could use path traversal
to overwrite arbitrary files on the host file system. (Reported by
MrSynAckster.)
* Metadata (UID, GID, attribute, modes) wasn't being savestated.
* NAND redirects weren't handled, except for NAND redirects at the root
of where the savestate was being done. (This only possibly matters if
TASing a Riivolution patch. The root of the savestate is at /tmp when
not TASing, and the only case where we do a NAND redirect is inside
/title if requested by a Riivolution patch.)
When calling `ShowMessageAlert` with a given `MsgType`, log the alert
with a `LogLevel` matching the `MsgType` instead of always using
`LogLevel::LERROR`.
SendGameStatus() was writing SyncIdentifierComparison as a u32 but the server reads it as a u8 enum, so the server always gets 0 (SameGame). This bug was introduced in commit 66276ac.
Remove the [[maybe_unused]] annotation from various parameters that are
unconditionally unused and comment out their names instead. This makes
it unambiguous that the variables are unused, while making the remaining
[[maybe_unused]] annotations more reliable indicators that those
variables are in fact used in some contexts.
These parameters are mostly in overridden functions where the override
doesn't need that particular variable.
Make `s_is_adapter_wanted` and the elements of `s_config_rumble_enabled`
atomic.
The CPU thread reads `s_is_adapter_wanted` and `s_config_rumble_enabled`
in `Output`, while the host thread writes to them in `RefreshConfig`.
The simplest way to trigger this race is to close the `Settings` window
while playing a game with the adapter active.
This fixes VolumeVerifier potentially calling TMDReader::GetIOSId for
invalid TMDs.
VolumeVerifier also has a call to TMDReader::GetContent that doesn't
check if the TMD is valid. In practice, this can't get called with an
invalid TMD because the previous commit made it so GetContentOffsets
returns an empty vector if the TMD is invalid, but I've added a check
inside TMDReader::GetContent just to be on the safe side.
I also made VolumeVerifier show a specifically worded problem if the
ticket or TMD is invalid. Before, invalid TMDs in Wii discs and WADs
and invalid tickets in WADs would show a more generic problem.
EGL is the de-facto GL context initialization API, including on X11
where it provides many additional features over GLX.
I’m planning on adding support for selecting the GPU (adapter in
Dolphin-speak) also to OpenGL, similarly to the Vulkan backend, and that
will require EGL, so let’s remove the legacy API first.