Add client side handling on incoming kick

This commit is contained in:
Dean Herbert 2021-08-11 18:31:04 +09:00
parent d9a4f018e6
commit 9b21ebd6d0

View File

@ -190,7 +190,8 @@ namespace osu.Game.Online.Multiplayer
return joinOrLeaveTaskChain.Add(async () =>
{
await scheduledReset.ConfigureAwait(false);
await LeaveRoomInternal().ConfigureAwait(false);
if (Room != null)
await LeaveRoomInternal().ConfigureAwait(false);
});
}
@ -391,6 +392,12 @@ namespace osu.Game.Online.Multiplayer
Task IMultiplayerClient.UserKicked(MultiplayerRoomUser user)
{
if (LocalUser == null)
return Task.CompletedTask;
if (user.Equals(LocalUser))
LeaveRoom();
// TODO: also inform users of the kick operation.
return ((IMultiplayerClient)this).UserLeft(user);
}