-
-
Notifications
You must be signed in to change notification settings - Fork 126
Support YRpp spawner's MP saves #1790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Metadorius
merged 12 commits into
Phobos-developers:develop
from
Metadorius:feature/savegame-spawner-compat
Aug 11, 2025
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6d5d611
Support YRpp spawner's MP saves
Metadorius ca0009f
Add docs/changelog/credits
Metadorius 3f32eaa
Fix missed doc changes
Metadorius d47ae94
Add temporary logging and fix the name a bit
Metadorius a2e5652
Merge remote-tracking branch 'origin/develop' into feature/savegame-s…
Metadorius d92f622
Fix the check not working and remove the logging
Metadorius 3d9a54b
Address feedback and don't use deprecated function
Metadorius d0358ad
GO AWAY, BEGONE
Metadorius dcace53
Add SAVEGAME.NET -> SVGM_XXX.NET rename hooks
Metadorius 229feda
Merge branch 'develop' into feature/savegame-spawner-compat
Metadorius 358d820
Port more of XNA client MP save routine and cleanup the code
Metadorius 5c6514e
Magic number -> `LJMP_OPCODE`
Metadorius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #include "SpawnerHelper.h" | ||
|
|
||
| bool SpawnerHelper::SaveGameEventHooked() | ||
| { | ||
| return SaveGameHookStart == 0xE9; | ||
Metadorius marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #pragma once | ||
|
|
||
| #include <Windows.h> | ||
|
|
||
| #include <Helpers/CompileTime.h> | ||
|
|
||
| class SpawnerHelper | ||
| { | ||
| private: | ||
| DEFINE_REFERENCE(const char, SaveGameHookStart, 0x4C7A14u); | ||
|
|
||
| public: | ||
| // Spawner hooks 0x4C7A14 and places an LJMP there. We check that memory address on whether it is a valid LJMP opcode | ||
| // and assume (unreliable, but I am open for better ideas) that if it is, the save game event hook is active. | ||
| // | ||
| // This doesn't account for Spawner::Active, so in a case where the spawner is loaded but not active this will fail, | ||
| // but oh well I am not engeneering a complicated solution just to fix that niche case which wouldn't happen 99% of the time. | ||
| // | ||
| // To read more about this mess and possibly engineer a better solution, look up the comments mentioning 0x4C7A14 in spawner. | ||
| // - Kerbiter | ||
| static bool SaveGameEventHooked(); | ||
| }; |
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.
Uh oh!
There was an error while loading. Please reload this page.