mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 06:32:55 +08:00
Merge pull request #19074 from peppy/fix-multiplayer-spectator-crash
Fix crash when currently played beatmap finishes download while multiplayer spectating
This commit is contained in:
commit
2eb79f38af
@ -338,11 +338,11 @@ namespace osu.Game.Database
|
|||||||
// import to store
|
// import to store
|
||||||
realm.Add(item);
|
realm.Add(item);
|
||||||
|
|
||||||
|
PostImport(item, realm);
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
PostImport(item, realm);
|
|
||||||
|
|
||||||
LogForModel(item, @"Import successfully completed!");
|
LogForModel(item, @"Import successfully completed!");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@ -479,7 +479,7 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform any final actions after the import has been committed to the database.
|
/// Perform any final actions before the import has been committed to the database.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model">The model prepared for import.</param>
|
/// <param name="model">The model prepared for import.</param>
|
||||||
/// <param name="realm">The current realm context.</param>
|
/// <param name="realm">The current realm context.</param>
|
||||||
|
@ -314,6 +314,9 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
|
|
||||||
public override void OnSuspending(ScreenTransitionEvent e)
|
public override void OnSuspending(ScreenTransitionEvent e)
|
||||||
{
|
{
|
||||||
|
// Should be a noop in most cases, but let's ensure beyond doubt that the beatmap is in a correct state.
|
||||||
|
updateWorkingBeatmap();
|
||||||
|
|
||||||
onLeaving();
|
onLeaving();
|
||||||
base.OnSuspending(e);
|
base.OnSuspending(e);
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public Score Score { get; private set; }
|
public Score Score { get; private set; }
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private BeatmapManager beatmapManager { get; set; }
|
|
||||||
|
|
||||||
private readonly BindableDouble volumeAdjustment = new BindableDouble();
|
private readonly BindableDouble volumeAdjustment = new BindableDouble();
|
||||||
private readonly Container gameplayContent;
|
private readonly Container gameplayContent;
|
||||||
private readonly LoadingLayer loadingLayer;
|
private readonly LoadingLayer loadingLayer;
|
||||||
@ -84,6 +81,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|||||||
GameplayClock.Source = masterClock;
|
GameplayClock.Source = masterClock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IBindable<WorkingBeatmap> beatmap { get; set; }
|
||||||
|
|
||||||
public void LoadScore([NotNull] Score score)
|
public void LoadScore([NotNull] Score score)
|
||||||
{
|
{
|
||||||
if (Score != null)
|
if (Score != null)
|
||||||
@ -91,7 +91,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|||||||
|
|
||||||
Score = score;
|
Score = score;
|
||||||
|
|
||||||
gameplayContent.Child = new PlayerIsolationContainer(beatmapManager.GetWorkingBeatmap(Score.ScoreInfo.BeatmapInfo), Score.ScoreInfo.Ruleset, Score.ScoreInfo.Mods)
|
gameplayContent.Child = new PlayerIsolationContainer(beatmap.Value, Score.ScoreInfo.Ruleset, Score.ScoreInfo.Mods)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = stack = new OsuScreenStack
|
Child = stack = new OsuScreenStack
|
||||||
|
Loading…
Reference in New Issue
Block a user