mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Add support for starting/stopping countdowns
This commit is contained in:
@ -16,6 +16,7 @@ using osu.Framework.Logging;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer.Countdown;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Online.Rooms.RoomStatuses;
|
||||
using osu.Game.Rulesets;
|
||||
@ -534,7 +535,24 @@ namespace osu.Game.Online.Multiplayer
|
||||
|
||||
public Task MatchEvent(MatchServerEvent e)
|
||||
{
|
||||
// not used by any match types just yet.
|
||||
if (Room == null)
|
||||
return Task.CompletedTask;
|
||||
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
if (Room == null)
|
||||
return;
|
||||
|
||||
switch (e)
|
||||
{
|
||||
case CountdownChangedEvent countdownChangedEvent:
|
||||
Room.Countdown = countdownChangedEvent.Countdown;
|
||||
break;
|
||||
}
|
||||
|
||||
RoomUpdated?.Invoke();
|
||||
}, false);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user