mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:43:01 +08:00
Fix multiplayer components updating when not alive
Should close https://github.com/ppy/osu/issues/15092. - [ ] Depends on https://github.com/ppy/osu-framework/pull/4826.
This commit is contained in:
parent
fb9c3fe72e
commit
0d86dab80a
@ -19,15 +19,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Client.RoomUpdated += OnRoomUpdated;
|
||||
|
||||
Client.UserLeft += UserLeft;
|
||||
Client.UserKicked += UserKicked;
|
||||
Client.UserJoined += UserJoined;
|
||||
Client.RoomUpdated += invokeOnRoomUpdated;
|
||||
Client.UserLeft += invokeUserLeft;
|
||||
Client.UserKicked += invokeUserKicked;
|
||||
Client.UserJoined += invokeUserJoined;
|
||||
|
||||
OnRoomUpdated();
|
||||
}
|
||||
|
||||
private void invokeOnRoomUpdated() => Scheduler.AddOnce(OnRoomUpdated);
|
||||
private void invokeUserJoined(MultiplayerRoomUser user) => Scheduler.AddOnce(UserJoined, user);
|
||||
private void invokeUserKicked(MultiplayerRoomUser user) => Scheduler.AddOnce(UserKicked, user);
|
||||
private void invokeUserLeft(MultiplayerRoomUser user) => Scheduler.AddOnce(UserLeft, user);
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a user has joined the room.
|
||||
/// </summary>
|
||||
@ -63,10 +67,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
{
|
||||
if (Client != null)
|
||||
{
|
||||
Client.UserLeft -= UserLeft;
|
||||
Client.UserKicked -= UserKicked;
|
||||
Client.UserJoined -= UserJoined;
|
||||
Client.RoomUpdated -= OnRoomUpdated;
|
||||
Client.RoomUpdated -= invokeOnRoomUpdated;
|
||||
Client.UserLeft -= invokeUserLeft;
|
||||
Client.UserKicked -= invokeUserKicked;
|
||||
Client.UserJoined -= invokeUserJoined;
|
||||
}
|
||||
|
||||
base.Dispose(isDisposing);
|
||||
|
Loading…
Reference in New Issue
Block a user