mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Rewrite rooms to store multiple active countdowns
Update test to the new structure
This commit is contained in:
@ -1,20 +0,0 @@
|
||||
// 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 MessagePack;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer.Countdown
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates a change to the <see cref="MultiplayerRoom"/>'s countdown.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CountdownChangedEvent : MatchServerEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The new countdown.
|
||||
/// </summary>
|
||||
[Key(0)]
|
||||
public MultiplayerCountdown? Countdown { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// 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 MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer.Countdown
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that a countdown started in the <see cref="MultiplayerRoom"/>.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CountdownStartedEvent : MatchServerEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The countdown that was started.
|
||||
/// </summary>
|
||||
[Key(0)]
|
||||
public readonly MultiplayerCountdown Countdown;
|
||||
|
||||
[JsonConstructor]
|
||||
[SerializationConstructor]
|
||||
public CountdownStartedEvent(MultiplayerCountdown countdown)
|
||||
{
|
||||
Countdown = countdown;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// 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 MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer.Countdown
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that a countdown was stopped in the <see cref="MultiplayerRoom"/>.
|
||||
/// </summary>
|
||||
[MessagePackObject]
|
||||
public class CountdownStoppedEvent : MatchServerEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier of the countdown that was stopped.
|
||||
/// </summary>
|
||||
[Key(0)]
|
||||
public readonly int ID;
|
||||
|
||||
[JsonConstructor]
|
||||
[SerializationConstructor]
|
||||
public CountdownStoppedEvent(int id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer.Countdown
|
||||
{
|
||||
@ -11,5 +12,14 @@ namespace osu.Game.Online.Multiplayer.Countdown
|
||||
[MessagePackObject]
|
||||
public class StopCountdownRequest : MatchUserRequest
|
||||
{
|
||||
[Key(0)]
|
||||
public readonly int ID;
|
||||
|
||||
[JsonConstructor]
|
||||
[SerializationConstructor]
|
||||
public StopCountdownRequest(int id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user