mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 12:22:55 +08:00
Fix flag reset on connection dropouts
This commit is contained in:
parent
a669c53df7
commit
922814fab3
@ -132,7 +132,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long? lastNotifiedDailyChallengeRoomId;
|
private long? lastDailyChallengeRoomID;
|
||||||
|
|
||||||
private void dailyChallengeChanged(ValueChangedEvent<DailyChallengeInfo?> _)
|
private void dailyChallengeChanged(ValueChangedEvent<DailyChallengeInfo?> _)
|
||||||
{
|
{
|
||||||
@ -152,18 +152,18 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
roomRequest.Success += room =>
|
roomRequest.Success += room =>
|
||||||
{
|
{
|
||||||
// force showing intro on the first time when a new daily challenge is up.
|
|
||||||
statics.SetValue(Static.DailyChallengeIntroPlayed, false);
|
|
||||||
|
|
||||||
Room = room;
|
Room = room;
|
||||||
cover.OnlineInfo = TooltipContent = room.Playlist.FirstOrDefault()?.Beatmap.BeatmapSet as APIBeatmapSet;
|
cover.OnlineInfo = TooltipContent = room.Playlist.FirstOrDefault()?.Beatmap.BeatmapSet as APIBeatmapSet;
|
||||||
|
|
||||||
// We only want to notify the user if a new challenge recently went live.
|
if (room.StartDate.Value != null && room.RoomID.Value != lastDailyChallengeRoomID)
|
||||||
if (room.StartDate.Value != null
|
|
||||||
&& Math.Abs((DateTimeOffset.Now - room.StartDate.Value!.Value).TotalSeconds) < 1800
|
|
||||||
&& room.RoomID.Value != lastNotifiedDailyChallengeRoomId)
|
|
||||||
{
|
{
|
||||||
lastNotifiedDailyChallengeRoomId = room.RoomID.Value;
|
lastDailyChallengeRoomID = room.RoomID.Value;
|
||||||
|
|
||||||
|
// new challenge is live, reset intro played static.
|
||||||
|
statics.SetValue(Static.DailyChallengeIntroPlayed, false);
|
||||||
|
|
||||||
|
// we only want to notify the user if the new challenge just went live.
|
||||||
|
if (Math.Abs((DateTimeOffset.Now - room.StartDate.Value!.Value).TotalSeconds) < 1800)
|
||||||
notificationOverlay?.Post(new NewDailyChallengeNotification(room));
|
notificationOverlay?.Post(new NewDailyChallengeNotification(room));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user