Reimplement native multiplayer command selection and ordering - #221
Open
Krarilotus wants to merge 2 commits into
Open
Krarilotus wants to merge 2 commits into
Krarilotus wants to merge 2 commits into
Conversation
TheRedDaemon
requested changes
Sep 10, 2026
| // Scan only the remaining physical ring entries. Wrapping and further | ||
| // batches belong to the caller; sorting here must not cross that boundary. | ||
| for (int slot = this->MBR_GameCommandID; slot < 200; ++slot) { | ||
| Commands::GameCommand& command = this->DAT_GameCommandArray[slot]; |
Contributor
There was a problem hiding this comment.
Try directly using the array access at the usage positions.
Creating temporaries creates other assembly and experience shows that pointer/reference temporaries were either rarely or not at all used in such contexts.
| ++pass; | ||
| swapped = 0; | ||
| for (int index = 1; index < static_cast<int>(this->MBR_someIndex); ++index) { | ||
| int* previous = this->MBR_SelectedGameCommands[index - 1]; |
Contributor
There was a problem hiding this comment.
Same here, try without the local pointers.
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.
TL;DR: Reconstruct how the game chooses and orders queued multiplayer commands.
OpenSHC needs a C++ implementation of this existing native function as part of its reconstruction goal.
Changes: Implement
GameSynchronyState::getCommandIDFromCommandSelectionStuffat0x480440with existing resolvers. Preserve the 100-command limit, player ordering, ring-end behavior and native failure cases.Review / testing: MSVC 2005 SP1 DLL build and 941 comparison cases per variant were reported passing. Linked reccmp similarity is 64.89%; the status file records that partial match. Further matching work remains. This is reconstruction, not a change to multiplayer rules.