1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 01:23:44 +08:00

Update presence on changes to multiplayer room

This commit is contained in:
Salman Ahmed 2024-03-11 11:18:59 +03:00
parent 169e2e1b4e
commit 8b730acb08

View File

@ -8,6 +8,7 @@ using DiscordRPC.Message;
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game; using osu.Game;
@ -91,6 +92,8 @@ namespace osu.Desktop
activity.BindValueChanged(_ => updateStatus()); activity.BindValueChanged(_ => updateStatus());
privacyMode.BindValueChanged(_ => updateStatus()); privacyMode.BindValueChanged(_ => updateStatus());
multiplayerClient.RoomUpdated += updateStatus;
client.Initialize(); client.Initialize();
} }
@ -269,6 +272,9 @@ namespace osu.Desktop
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
if (multiplayerClient.IsNotNull())
multiplayerClient.RoomUpdated -= updateStatus;
client.Dispose(); client.Dispose();
base.Dispose(isDisposing); base.Dispose(isDisposing);
} }