Skip to content
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

Can ReplayAudioRecorder be modified so that the replay editor becomes compatible with the multiplayer mod? #3

Open
Inwerpsel opened this issue Aug 14, 2019 · 1 comment

Comments

@Inwerpsel
Copy link

Mod Name
XLShredReplayEditor
Version numbers
Game version: 2018.3.0.7248423
Mod manager version: 0.20.0.0
XLShredReplayEditor version: 1.3.0
Multiplayer mod version: 0.2.3

Describe the bug
Having both mods enabled at the same time causes the game to crash when connected to a multiplayer game. More specifically the game crashes when the replay editor is recording and at the same time the multiplayer mod is creating the character for another player in the game.

To Reproduce
Steps to reproduce the behavior:

  1. Enable both multiplayer-mod and replay-editor mod
  2. Make sure the replay editor is in state recording
  3. Join a multiplayer server that has at least one other player connected to it, or join empty game and wait for another player to connect.
  4. The game crashes as the other player is being spawned.

Expected behavior
Both mods should be able to work together without crashing the game.

Logfile
I currently don't have this accessible, but the crash log each time reports on "attempting to read an invalid address".

Additional context
I submitted this as a bug report but perhaps it could be regarded as a feature request.

I narrowed down the incompatibility to the moment that the multiplayer mod spawns another player (see https://github.com/silentbaws/XLMultiplayer/blob/master/XLMultiplayer/MultiplayerPlayerController.cs#L445). Each time this happens the new character is created from the main player's skater and board in the following way (I'll exclude the board to which the same happens but this isn't causing issues).

  1. All monobehaviors in the original skater are set to disabled.
  2. A copy of the skater is created using Object.Instantiate.
  3. All monobehaviors in the new skater are destroyed.
  4. All monobehaviors in the original skater are enabled again.

The game crashes as a result of step 1 because one of those monobehaviors is ReplayAudioRecorder, which has an onDisable lifecycle event which closes the memory stream.

I am sure that this is the only point where the mods are incompatible (except for an issue when removing the player, described below) as I modified the multiplayer mod to not disable the ReplayAudioRecorder in step 1, after which the crash when a player joins doesn't occur anymore.

However with the above fix the game crashes when a player is disconnected and his character is removed. I'm not sure why that happens but it would probably require quite some changes in the multiplayer mod to prevent that.

So my question is the following: can this perhaps easily be fixed in the replay editor mod? There might be a few options:

  • avoiding closing the steam in onDisable
  • re-opening the stream in onEnable
@Inwerpsel
Copy link
Author

Or perhaps you could suggest a way this could be fixed in https://github.com/silentbaws/XLMultiplayer if that would work better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant