Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MultiplayerCore/Beatmaps/BeatSaverBeatmapLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public override Dictionary<string, Dictionary<BeatmapDifficulty, string[]>> Requ
};
if (!reqs.ContainsKey(characteristic))
reqs.Add(characteristic, new());
string[] diffReqs = new string[0];
var diffReqs = new List<string>();
//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;
}
Expand Down
1 change: 1 addition & 0 deletions MultiplayerCore/Beatmaps/Serializable/DifficultyColors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions MultiplayerCore/UI/MpPerPlayerUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ internal class MpPerPlayerUI : IInitializable, IDisposable
private List<string>? _allowedDiffs;
private CanvasGroup? _difficultyCanvasGroup;
private MpStatusData? _currentStatusData;
private bool _skipUpdateHandler = false;

private readonly SiraLog _logger;

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -428,6 +433,8 @@ public bool PerPlayerDifficulty
set
{
ppdt!.Value = value;

if (_skipUpdateHandler) return;
_multiplayerSessionManager.Send(new MpPerPlayerPacket
{
PPDEnabled = ppdt.Value,
Expand All @@ -443,6 +450,8 @@ public bool PerPlayerModifiers
set
{
ppmt!.Value = value;

if (_skipUpdateHandler) return;
_multiplayerSessionManager.Send(new MpPerPlayerPacket
{
PPDEnabled = ppdt!.Value,
Expand Down