mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 14:27:25 +08:00
Update presence on changes to multiplayer room
This commit is contained in:
parent
169e2e1b4e
commit
8b730acb08
@ -8,6 +8,7 @@ using DiscordRPC.Message;
|
||||
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;
|
||||
@ -91,6 +92,8 @@ namespace osu.Desktop
|
||||
activity.BindValueChanged(_ => updateStatus());
|
||||
privacyMode.BindValueChanged(_ => updateStatus());
|
||||
|
||||
multiplayerClient.RoomUpdated += updateStatus;
|
||||
|
||||
client.Initialize();
|
||||
}
|
||||
|
||||
@ -269,6 +272,9 @@ namespace osu.Desktop
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
if (multiplayerClient.IsNotNull())
|
||||
multiplayerClient.RoomUpdated -= updateStatus;
|
||||
|
||||
client.Dispose();
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user