mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 22:35:23 +08:00
Change exceptions which should be returned to the user to HubException type
See https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.signalr.hubexception?view=aspnetcore-5.0.
This commit is contained in:
parent
48129c52d6
commit
c92c2cbfc0
@ -2,14 +2,22 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace osu.Game.Online.RealtimeMultiplayer
|
||||
{
|
||||
public class AlreadyInRoomException : Exception
|
||||
[Serializable]
|
||||
public class AlreadyInRoomException : HubException
|
||||
{
|
||||
public AlreadyInRoomException()
|
||||
: base("This user is already in a multiplayer room.")
|
||||
{
|
||||
}
|
||||
|
||||
protected AlreadyInRoomException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,22 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace osu.Game.Online.RealtimeMultiplayer
|
||||
{
|
||||
public class InvalidStateChangeException : Exception
|
||||
[Serializable]
|
||||
public class InvalidStateChangeException : HubException
|
||||
{
|
||||
public InvalidStateChangeException(MultiplayerUserState oldState, MultiplayerUserState newState)
|
||||
: base($"Cannot change from {oldState} to {newState}")
|
||||
{
|
||||
}
|
||||
|
||||
protected InvalidStateChangeException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,22 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace osu.Game.Online.RealtimeMultiplayer
|
||||
{
|
||||
public class NotHostException : Exception
|
||||
[Serializable]
|
||||
public class NotHostException : HubException
|
||||
{
|
||||
public NotHostException()
|
||||
: base("User is attempting to perform a host level operation while not the host")
|
||||
{
|
||||
}
|
||||
|
||||
protected NotHostException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,22 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace osu.Game.Online.RealtimeMultiplayer
|
||||
{
|
||||
public class NotJoinedRoomException : Exception
|
||||
[Serializable]
|
||||
public class NotJoinedRoomException : HubException
|
||||
{
|
||||
public NotJoinedRoomException()
|
||||
: base("This user has not yet joined a multiplayer room.")
|
||||
{
|
||||
}
|
||||
|
||||
protected NotJoinedRoomException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user