Skip to content

Commit

Permalink
Update presence on changes to multiplayer room
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Mar 11, 2024
1 parent 169e2e1 commit 8b730ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osu.Desktop/DiscordRichPresence.cs
Expand Up @@ -8,6 +8,7 @@
using Newtonsoft.Json;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Logging;
using osu.Game;
Expand Down Expand Up @@ -91,6 +92,8 @@ private void load(OsuConfigManager config)
activity.BindValueChanged(_ => updateStatus());
privacyMode.BindValueChanged(_ => updateStatus());

multiplayerClient.RoomUpdated += updateStatus;

client.Initialize();
}

Expand Down Expand Up @@ -269,6 +272,9 @@ private static bool tryParseRoomSecret(string secretJson, out long roomId, out s

protected override void Dispose(bool isDisposing)
{
if (multiplayerClient.IsNotNull())
multiplayerClient.RoomUpdated -= updateStatus;

client.Dispose();
base.Dispose(isDisposing);
}
Expand Down

0 comments on commit 8b730ac

Please sign in to comment.