diff --git a/.gitignore b/.gitignore index 1fec94d82baa..7247c6c7899b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +# C# Dev Kit cache +*.lscache + # User-specific files *.suo *.user diff --git a/osu.Game/Online/Multiplayer/Countdown/CountdownTickEvent.cs b/osu.Game/Online/Multiplayer/Countdown/CountdownTickEvent.cs new file mode 100644 index 000000000000..7afef4c0cd9b --- /dev/null +++ b/osu.Game/Online/Multiplayer/Countdown/CountdownTickEvent.cs @@ -0,0 +1,35 @@ +// Copyright (c) ppy Pty Ltd . 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 +{ + /// + /// Indicates a countdown tick (periodic reminder) in a . + /// + [MessagePackObject] + public class CountdownTickEvent : MatchServerEvent + { + /// + /// The identifier of the countdown this tick pertains to. + /// + [Key(0)] + public readonly int CountdownId; + + /// + /// Number of seconds (fractional) until the completion of the countdown. + /// + [Key(1)] + public readonly double Seconds; + + [JsonConstructor] + [SerializationConstructor] + public CountdownTickEvent(int countdownId, double seconds) + { + CountdownId = countdownId; + Seconds = seconds; + } + } +} diff --git a/osu.Game/Online/Multiplayer/Countdown/ReminderCountdown.cs b/osu.Game/Online/Multiplayer/Countdown/ReminderCountdown.cs new file mode 100644 index 000000000000..43cdc1edf06c --- /dev/null +++ b/osu.Game/Online/Multiplayer/Countdown/ReminderCountdown.cs @@ -0,0 +1,16 @@ +// Copyright (c) ppy Pty Ltd . 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 +{ + /// + /// A countdown for match notifications/reminders, does not start the match. + /// + [MessagePackObject] + public class ReminderCountdown : MultiplayerCountdown + { + public override bool IsExclusive => true; + } +} diff --git a/osu.Game/Online/Multiplayer/MultiplayerCountdown.cs b/osu.Game/Online/Multiplayer/MultiplayerCountdown.cs index 9f4d7f1039b8..d1ac88be9618 100644 --- a/osu.Game/Online/Multiplayer/MultiplayerCountdown.cs +++ b/osu.Game/Online/Multiplayer/MultiplayerCountdown.cs @@ -18,6 +18,7 @@ namespace osu.Game.Online.Multiplayer [Union(2, typeof(ServerShuttingDownCountdown))] [Union(3, typeof(MatchmakingStageCountdown))] [Union(4, typeof(RankedPlayStageCountdown))] + [Union(5, typeof(ReminderCountdown))] public abstract class MultiplayerCountdown { /// diff --git a/osu.Game/Online/SignalRWorkaroundTypes.cs b/osu.Game/Online/SignalRWorkaroundTypes.cs index 06e8451205b2..9fcc0b4654e7 100644 --- a/osu.Game/Online/SignalRWorkaroundTypes.cs +++ b/osu.Game/Online/SignalRWorkaroundTypes.cs @@ -37,6 +37,7 @@ internal static class SignalRWorkaroundTypes (typeof(MatchStartCountdown), typeof(MultiplayerCountdown)), (typeof(ForceGameplayStartCountdown), typeof(MultiplayerCountdown)), (typeof(ServerShuttingDownCountdown), typeof(MultiplayerCountdown)), + (typeof(ReminderCountdown), typeof(MultiplayerCountdown)), // metadata (typeof(UserActivity.ChoosingBeatmap), typeof(UserActivity)),