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

[BUG] Beat Saber 1.28.0 stalls after CustomSongColorsPatch #36

Closed
InvoxiPlayGames opened this issue Mar 4, 2023 · 2 comments
Closed

Comments

@InvoxiPlayGames
Copy link

MultiplayerCore Version and Download Source
MultiplayerCore v1.1.2 from GitHub releases (the version built from source crashes with infinite NullReferenceException errors, so I haven't been able to narrow down any issues myself)

Your Platform
Steam on PC, version 1.28.0 (using a self-compiled build of SongCore commit 7a7bb3e)

Describe the bug
When attempting to play a song on official Beat Saber servers with MultiplayerCore installed, the game stalls after the 5 second countdown when starting a song. Uninstalling MultiplayerCore works as intended.

To Reproduce

  1. Launch the game and go on multiplayer
  2. Click on any song
  3. Start the song
  4. See error in the logs, the game will keep you stalled in the purple environment (still able to exit the UI, so not a softlock or a crash)

Expected behavior
The song should be playing normally.

Log

[CRITICAL @ 21:56:06 | UnityEngine] NullReferenceException: Object reference not set to an instance of an object
[CRITICAL @ 21:56:06 | UnityEngine] MultiplayerCore.Patches.CustomSongColorsPatch.Prefix (IDifficultyBeatmap& difficultyBeatmap, ColorScheme& overrideColorScheme) (at <2af17fc095ca4d6aa38c7d9ef553c66c>:0)
[CRITICAL @ 21:56:06 | UnityEngine] (wrapper dynamic-method) MultiplayerLevelScenesTransitionSetupDataSO.DMD<MultiplayerLevelScenesTransitionSetupDataSO::Init>(MultiplayerLevelScenesTransitionSetupDataSO,string,IPreviewBeatmapLevel,BeatmapDifficulty,BeatmapCharacteristicSO,IDifficultyBeatmap,ColorScheme,GameplayModifiers,PlayerSpecificSettings,PracticeSettings,bool)
[CRITICAL @ 21:56:06 | UnityEngine] MenuTransitionsHelper.StartMultiplayerLevel (System.String gameMode, IPreviewBeatmapLevel previewBeatmapLevel, BeatmapDifficulty beatmapDifficulty, BeatmapCharacteristicSO beatmapCharacteristic, IDifficultyBeatmap difficultyBeatmap, ColorScheme overrideColorScheme, GameplayModifiers gameplayModifiers, PlayerSpecificSettings playerSpecificSettings, PracticeSettings practiceSettings, System.String backButtonText, System.Boolean useTestNoteCutSoundEffects, System.Action beforeSceneSwitchCallback, System.Action`1[T] afterSceneSwitchCallback, System.Action`2[T1,T2] levelFinishedCallback, System.Action`1[T] didDisconnectCallback) (at <c539348cd3264f5491de978be0c3642c>:0)
[CRITICAL @ 21:56:06 | UnityEngine] MenuTransitionsHelper.StartMultiplayerLevel (System.String gameMode, IPreviewBeatmapLevel previewBeatmapLevel, BeatmapDifficulty beatmapDifficulty, BeatmapCharacteristicSO beatmapCharacteristic, IDifficultyBeatmap difficultyBeatmap, ColorScheme overrideColorScheme, GameplayModifiers gameplayModifiers, PlayerSpecificSettings playerSpecificSettings, PracticeSettings practiceSettings, System.String backButtonText, System.Boolean useTestNoteCutSoundEffects, System.Action beforeSceneSwitchCallback, System.Action`2[T1,T2] levelFinishedCallback, System.Action`1[T] didDisconnectCallback) (at <c539348cd3264f5491de978be0c3642c>:0)
[CRITICAL @ 21:56:06 | UnityEngine] (wrapper dynamic-method) LobbyGameStateController.DMD<LobbyGameStateController::StartMultiplayerLevel>(LobbyGameStateController,ILevelGameplaySetupData,IDifficultyBeatmap,System.Action)
[CRITICAL @ 21:56:06 | UnityEngine] LobbyGameStateController.HandleMultiplayerLevelLoaderCountdownFinished (ILevelGameplaySetupData gameplaySetupData, IDifficultyBeatmap difficultyBeatmap) (at <c539348cd3264f5491de978be0c3642c>:0)
[CRITICAL @ 21:56:06 | UnityEngine] (wrapper dynamic-method) MultiplayerLevelLoader.DMD<MultiplayerLevelLoader::Tick>(MultiplayerLevelLoader)
[CRITICAL @ 21:56:06 | UnityEngine] MultiplayerCore.Objects.MpLevelLoader.Tick () (at <2af17fc095ca4d6aa38c7d9ef553c66c>:0)
[CRITICAL @ 21:56:06 | UnityEngine] Zenject.TickablesTaskUpdater.UpdateItem (Zenject.ITickable task) (at <ed5758d978ce4539b312e960e20e9230>:0)
[CRITICAL @ 21:56:06 | UnityEngine] Zenject.TaskUpdater`1[TTask].UpdateRange (System.Int32 minPriority, System.Int32 maxPriority) (at <ed5758d978ce4539b312e960e20e9230>:0)
[CRITICAL @ 21:56:06 | UnityEngine] Zenject.TaskUpdater`1[TTask].UpdateAll () (at <ed5758d978ce4539b312e960e20e9230>:0)
[CRITICAL @ 21:56:06 | UnityEngine] Zenject.TickableManager.Update () (at <ed5758d978ce4539b312e960e20e9230>:0)
[CRITICAL @ 21:56:06 | UnityEngine] Zenject.MonoKernel.Update () (at <ed5758d978ce4539b312e960e20e9230>:0)

Additional context
I haven't been able to properly test this extensively with more than just a single player in the lobby. Patching out the CustomSongColorsPatch manually in dnSpy was able to resolve the issue as well.

@roydejong
Copy link
Collaborator

roydejong commented Mar 5, 2023

+1, I've seen this issue happening as well with the same set of mods.

On OST, DLC and custom songs. Effectively prevents multiplayer levels from starting altogether.

I've also tested this on a modded server, so this seems to be happening in any environment.

@roydejong
Copy link
Collaborator

Just to follow-up, found the root cause:

This is caused by SongCore changes. MultiplayerCore attempts to read a config value from SongCore that no longer exists:

var customSongColors = (bool)typeof(SongCore.Plugin).Assembly.GetType("SongCore.SConfiguration").GetProperty("CustomSongColors").GetValue(sConfiguration);

However, I don't think this patch is needed at all in MultiplayerCore anymore. SongCore now handles custom song colors in multiplayer itself:
Kylemc1413/SongCore#48

I've verified the SongCore patch works, so I'll submit a PR for MultiplayerCore to remove it here.

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

2 participants