mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Update LastPlayed
on gameplay starting in a SubmittingPlayer
This commit is contained in:
parent
4b96d74b0c
commit
ab3ec80159
@ -11,6 +11,8 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -117,6 +119,23 @@ namespace osu.Game.Screens.Play
|
||||
await submitScore(score).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private RealmAccess realm { get; set; }
|
||||
|
||||
protected override void StartGameplay()
|
||||
{
|
||||
base.StartGameplay();
|
||||
|
||||
// User expectation is that last played should be updated when entering the gameplay loop
|
||||
// from multiplayer / playlists / solo, even when using autoplay mod.
|
||||
realm.WriteAsync(r =>
|
||||
{
|
||||
var realmBeatmap = r.Find<BeatmapInfo>(Beatmap.Value.BeatmapInfo.ID);
|
||||
if (realmBeatmap != null)
|
||||
realmBeatmap.LastPlayed = DateTimeOffset.Now;
|
||||
});
|
||||
}
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
{
|
||||
bool exiting = base.OnExiting(e);
|
||||
|
Loading…
Reference in New Issue
Block a user