1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 01:42:55 +08:00

Add various logging of global WorkingBeatmap state changes

This commit is contained in:
Dean Herbert 2022-06-27 18:41:27 +09:00
parent e131101708
commit 50c1c066de
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 to 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

@ -494,7 +494,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())
{
@ -519,7 +519,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);
}
@ -737,7 +737,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);
}