Skip to content

Commit

Permalink
Force exit to main menu when presenting scores from within playlists …
Browse files Browse the repository at this point in the history
…/ multiplayer

- Closes ppy#29152
- Partially reverts ppy#29097
- Reopens ppy#26666

When testing I failed to predict that in multiplayer there can be a
different beatmap in the playlist queue. If this is the case,
`PresentScore()` will exit out to `Multiplayer`, whose `RoomSubScreen`
will update the selected item - and thus, the global beatmap - to the
next item in queue, at which point trying to play games with "not
touching the global beatmap bindable if we don't need to" fail to work,
because the bindable *must* be touched for correct operation, yet it
cannot (because `OnlinePlayScreen`s disable it).

I'm not sure what the fix is here:

- making replay player somehow independent of the global beatmap?
- not exiting out to multiplayer, but instead doing the present from the
  results screen itself? if so, then how to ensure the screen stack
  can't overflow to infinity?

so I'm just reverting the broken part. The daily challenge part is left
in because as is it should not cause issues.
  • Loading branch information
bdach authored and CloneWith committed Aug 1, 2024
1 parent 60e4a31 commit ccdfc1d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
using osu.Game.Screens.Edit;
using osu.Game.Screens.Footer;
using osu.Game.Screens.Menu;
using osu.Game.Screens.OnlinePlay;
using osu.Game.Screens.OnlinePlay.DailyChallenge;
using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Screens.Play;
Expand Down Expand Up @@ -757,11 +756,13 @@ public void PresentScore(IScoreInfo score, ScorePresentType presentType = ScoreP
// As a special case, if the beatmap and ruleset already match, allow immediately displaying the score from song select.
// This is guaranteed to not crash, and feels better from a user's perspective (ie. if they are clicking a score in the
// song select leaderboard).
// Similar exemptions are made here for online flows where there are good chances that beatmap and ruleset match
// (playlists / multiplayer / daily challenge).
// Similar exemptions are made here for daily challenge where it is guaranteed that beatmap and ruleset match.
// `OnlinePlayScreen` is excluded because when resuming back to it,
// `RoomSubScreen` changes the global beatmap to the next playlist item on resume,
// which may not match the score, and thus crash.
IEnumerable<Type> validScreens =
Beatmap.Value.BeatmapInfo.Equals(databasedBeatmap) && Ruleset.Value.Equals(databasedScore.ScoreInfo.Ruleset)
? new[] { typeof(SongSelect), typeof(OnlinePlayScreen), typeof(DailyChallenge) }
? new[] { typeof(SongSelect), typeof(DailyChallenge) }
: Array.Empty<Type>();

PerformFromScreen(screen =>
Expand Down

0 comments on commit ccdfc1d

Please sign in to comment.