1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-19 04:17:27 +08:00

Add exception to be thrown when an operation is requested requiring host when not host

This commit is contained in:
Dean Herbert 2020-12-08 19:06:08 +09:00
parent 2433838d58
commit df908f90b2
2 changed files with 17 additions and 0 deletions

View File

@ -23,6 +23,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
/// Transfer the host of the currently joined room to another user in the room.
/// </summary>
/// <param name="userId">The new user which is to become host.</param>
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
Task TransferHost(long userId);
/// <summary>
@ -41,6 +42,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
/// <summary>
/// As the host of a room, start the match.
/// </summary>
/// <exception cref="NotHostException">A user other than the current host is attempting to start the game.</exception>
Task StartMatch();
}
}

View File

@ -0,0 +1,15 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
namespace osu.Game.Online.RealtimeMultiplayer
{
public class NotHostException : Exception
{
public NotHostException()
: base("User is attempting to perform a host level operation while not the host")
{
}
}
}