(cheevos) include achievement state in netplay states #17416
+419
−90
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.
Description
Netplay uses special save states to keep clients in sync with the server, but those save states don't include achievement state. As a result, the achievement state can still get desynchronized.
This PR updates the
NETPLAY_CMD_LOAD_SAVESTATE
netplay command to also pass the achievement state for protocol version 7 (the raw core snapshot will still be passed for protocols 5 and 6). I considered providing a new command, but the command just copies the data into a buffer and the processing occurs elsewhere.Also fixes an issue where achievement processing was not occurring if the game continued to run behind the menu (netplay Allow Pausing is off or Pause Content when Menu is Active is off).
Related Issues
n/a
Related Pull Requests
n/a
Reviewers
Anyone knowledgeable about the netplay code, or who has opinions on the netplay protocol.
I've tested this code connecting to this code with various states of achievement enablement both with active client and spectating client. I've also tested this code connecting to 1.20 code (both as client and as server) with achievements enabled. All testing has been using LAN hosts (mostly two instances on the same machine). Testing sessions have been limited to a few minutes per configuration and mostly just playing from the host and making sure the client reflected the host state.