From 12aae729685a1652c80461c11cd940898c0ae927 Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Thu, 9 Apr 2026 21:52:30 +0400 Subject: [PATCH 1/3] Avoid sending packets when programmatically changing ppd and ppm --- MultiplayerCore/UI/MpPerPlayerUI.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MultiplayerCore/UI/MpPerPlayerUI.cs b/MultiplayerCore/UI/MpPerPlayerUI.cs index 603f130..aa343f4 100644 --- a/MultiplayerCore/UI/MpPerPlayerUI.cs +++ b/MultiplayerCore/UI/MpPerPlayerUI.cs @@ -39,6 +39,7 @@ internal class MpPerPlayerUI : IInitializable, IDisposable private List? _allowedDiffs; private CanvasGroup? _difficultyCanvasGroup; private MpStatusData? _currentStatusData; + private bool _skipUpdateHandler = false; private readonly SiraLog _logger; @@ -166,8 +167,10 @@ public void DidActivate(bool firstActivation, bool addedToHierarchy, bool screen if (addedToHierarchy) { // Reset our buttons + _skipUpdateHandler = true; ppdt!.Value = false; ppmt!.Value = false; + _skipUpdateHandler = false; // Request Updated state _multiplayerSessionManager.Send(new GetMpPerPlayerPacket()); @@ -328,8 +331,10 @@ private void HandleMpPerPlayerPacket(MpPerPlayerPacket packet, IConnectedPlayer if ((packet.PPDEnabled != PerPlayerDifficulty || packet.PPMEnabled != PerPlayerModifiers) && ppdt != null && ppmt != null && player.isConnectionOwner) { + _skipUpdateHandler = true; ppdt.Value = packet.PPDEnabled; ppmt.Value = packet.PPMEnabled; + _skipUpdateHandler = false; } else if (!player.isConnectionOwner) { @@ -428,6 +433,8 @@ public bool PerPlayerDifficulty set { ppdt!.Value = value; + + if (_skipUpdateHandler) return; _multiplayerSessionManager.Send(new MpPerPlayerPacket { PPDEnabled = ppdt.Value, @@ -443,6 +450,8 @@ public bool PerPlayerModifiers set { ppmt!.Value = value; + + if (_skipUpdateHandler) return; _multiplayerSessionManager.Send(new MpPerPlayerPacket { PPDEnabled = ppdt!.Value, From a7131ea20ab5df92c81e32784a25414ca6666840 Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Thu, 9 Apr 2026 21:54:31 +0400 Subject: [PATCH 2/3] Fix beatsaver requirements parsing --- MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs b/MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs index 7fc30dd..a653eb3 100644 --- a/MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs +++ b/MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs @@ -45,14 +45,14 @@ public override Dictionary> Requ }; if (!reqs.ContainsKey(characteristic)) reqs.Add(characteristic, new()); - string[] diffReqs = new string[0]; + var diffReqs = new List(); //if (difficulty.Chroma) // diffReqs.Append("Chroma"); if (difficulty.NoodleExtensions) - diffReqs.Append("Noodle Extensions"); + diffReqs.Add("Noodle Extensions"); if (difficulty.MappingExtensions) - diffReqs.Append("Mapping Extensions"); - reqs[characteristic][difficultyKey] = diffReqs; + diffReqs.Add("Mapping Extensions"); + reqs[characteristic][difficultyKey] = diffReqs.ToArray(); } return reqs; } From b9eee07aabd6e998ecd0b8927b621b6aaa8b01db Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Thu, 9 Apr 2026 21:54:51 +0400 Subject: [PATCH 3/3] Add missing obstacle color --- MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs b/MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs index d24f7f1..23665fd 100644 --- a/MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs +++ b/MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs @@ -29,6 +29,7 @@ public DifficultyColors(MapColor? colorLeft, MapColor? colorRight, MapColor? env EnvColorRight = envColorRight; EnvColorLeftBoost = envColorLeftBoost; EnvColorRightBoost = envColorRightBoost; + ObstacleColor = obstacleColor; } public void Serialize(NetDataWriter writer)