mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09: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.
|
/// Transfer the host of the currently joined room to another user in the room.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">The new user which is to become host.</param>
|
/// <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);
|
Task TransferHost(long userId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -41,6 +42,7 @@ namespace osu.Game.Online.RealtimeMultiplayer
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// As the host of a room, start the match.
|
/// As the host of a room, start the match.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <exception cref="NotHostException">A user other than the current host is attempting to start the game.</exception>
|
||||||
Task StartMatch();
|
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