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:
parent
2433838d58
commit
df908f90b2
@ -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();
|
||||
}
|
||||
}
|
||||
|
15
osu.Game/Online/RealtimeMultiplayer/NotHostException.cs
Normal file
15
osu.Game/Online/RealtimeMultiplayer/NotHostException.cs
Normal 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")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user