Merge branch 'master' into realm-ruleset-store-thread-correctness

This commit is contained in:
Dean Herbert
2021-11-08 15:21:30 +09:00
25 changed files with 297 additions and 338 deletions

View File

@ -207,17 +207,11 @@ namespace osu.Game
dependencies.CacheAs<ISkinSource>(SkinManager);
// needs to be done here rather than inside SkinManager to ensure thread safety of CurrentSkinInfo.
SkinManager.ItemRemoved.BindValueChanged(weakRemovedInfo =>
SkinManager.ItemRemoved += item => Schedule(() =>
{
if (weakRemovedInfo.NewValue.TryGetTarget(out var removedInfo))
{
Schedule(() =>
{
// check the removed skin is not the current user choice. if it is, switch back to default.
if (removedInfo.ID == SkinManager.CurrentSkinInfo.Value.ID)
SkinManager.CurrentSkinInfo.Value = SkinInfo.Default;
});
}
// check the removed skin is not the current user choice. if it is, switch back to default.
if (item.ID == SkinManager.CurrentSkinInfo.Value.ID)
SkinManager.CurrentSkinInfo.Value = SkinInfo.Default;
});
EndpointConfiguration endpoints = UseDevelopmentServer ? (EndpointConfiguration)new DevelopmentEndpointConfiguration() : new ProductionEndpointConfiguration();
@ -252,17 +246,8 @@ namespace osu.Game
return ScoreManager.QueryScores(s => beatmapIds.Contains(s.BeatmapInfo.ID)).ToList();
}
BeatmapManager.ItemRemoved.BindValueChanged(i =>
{
if (i.NewValue.TryGetTarget(out var item))
ScoreManager.Delete(getBeatmapScores(item), true);
});
BeatmapManager.ItemUpdated.BindValueChanged(i =>
{
if (i.NewValue.TryGetTarget(out var item))
ScoreManager.Undelete(getBeatmapScores(item), true);
});
BeatmapManager.ItemRemoved += item => ScoreManager.Delete(getBeatmapScores(item), true);
BeatmapManager.ItemUpdated += item => ScoreManager.Undelete(getBeatmapScores(item), true);
dependencies.Cache(difficultyCache = new BeatmapDifficultyCache());
AddInternal(difficultyCache);