1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 18:52:57 +08:00

Merge pull request #18872 from peppy/add-working-beatmap-changed-logging

Add various logging of global `WorkingBeatmap` state changes
This commit is contained in:
Dan Balasescu 2022-06-27 21:34:05 +09:00 committed by GitHub
commit d43b980a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 2 deletions

View File

@ -486,6 +486,7 @@ namespace osu.Game
/// </remarks>
public void PresentBeatmap(IBeatmapSetInfo beatmap, Predicate<BeatmapInfo> difficultyCriteria = null)
{
Logger.Log($"Beginning {nameof(PresentBeatmap)} with beatmap {beatmap}");
Live<BeatmapSetInfo> databasedSet = null;
if (beatmap.OnlineID > 0)
@ -522,6 +523,7 @@ namespace osu.Game
}
else
{
Logger.Log($"Completing {nameof(PresentBeatmap)} with beatmap {beatmap} ruleset {selection.Ruleset}");
Ruleset.Value = selection.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection);
}
@ -534,6 +536,8 @@ namespace osu.Game
/// </summary>
public void PresentScore(IScoreInfo score, ScorePresentType presentType = ScorePresentType.Results)
{
Logger.Log($"Beginning {nameof(PresentScore)} with score {score}");
// The given ScoreInfo may have missing properties if it was retrieved from online data. Re-retrieve it from the database
// to ensure all the required data for presenting a replay are present.
ScoreInfo databasedScoreInfo = null;
@ -568,6 +572,8 @@ namespace osu.Game
PerformFromScreen(screen =>
{
Logger.Log($"{nameof(PresentScore)} updating beatmap ({databasedBeatmap}) and ruleset ({databasedScore.ScoreInfo.Ruleset} to match score");
Ruleset.Value = databasedScore.ScoreInfo.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap);

View File

@ -14,6 +14,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Framework.Threading;
using osu.Game.Beatmaps;
using osu.Game.Database;
@ -106,10 +107,12 @@ namespace osu.Game.Overlays
if (beatmap.Disabled)
return;
Logger.Log($"{nameof(MusicController)} skipping next track to {nameof(EnsurePlayingSomething)}");
NextTrack();
}
else if (!IsPlaying)
{
Logger.Log($"{nameof(MusicController)} starting playback to {nameof(EnsurePlayingSomething)}");
Play();
}
}

View File

@ -10,6 +10,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
@ -302,6 +303,8 @@ namespace osu.Game.Screens.Menu
public void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset)
{
Logger.Log($"{nameof(MainMenu)} completing {nameof(PresentBeatmap)} with beatmap {beatmap} ruleset {ruleset}");
Beatmap.Value = beatmap;
Ruleset.Value = ruleset;

View File

@ -497,7 +497,7 @@ namespace osu.Game.Screens.Select
// clear pending task immediately to track any potential nested debounce operation.
selectionChangedDebounce = null;
Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ShortName ?? "null"}");
Logger.Log($"Song select updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ShortName ?? "null"}");
if (transferRulesetValue())
{
@ -522,7 +522,7 @@ namespace osu.Game.Screens.Select
// In these cases, the other component has already loaded the beatmap, so we don't need to do so again.
if (!EqualityComparer<BeatmapInfo>.Default.Equals(beatmap, Beatmap.Value.BeatmapInfo))
{
Logger.Log($"beatmap changed from \"{Beatmap.Value.BeatmapInfo}\" to \"{beatmap}\"");
Logger.Log($"Song select changing beatmap from \"{Beatmap.Value.BeatmapInfo}\" to \"{beatmap?.ToString() ?? "null"}\"");
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap);
}
@ -740,7 +740,10 @@ namespace osu.Game.Screens.Select
bool isNewTrack = !lastTrack.TryGetTarget(out var last) || last != track;
if (!track.IsRunning && (music.UserPauseRequested != true || isNewTrack))
{
Logger.Log($"Song select decided to {nameof(ensurePlayingSelected)}");
music.Play(true);
}
lastTrack.SetTarget(track);
}