From 9c8df4e6d1a041c0b2fc19873aa8ae8e1d0d9fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 22:23:58 +0100 Subject: [PATCH] Run score conversion for previously-imported scores --- osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs | 3 +++ osu.Game/BackgroundDataStoreProcessor.cs | 3 +-- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs index e65088ca2e..43ce7200d2 100644 --- a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs +++ b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs @@ -127,8 +127,11 @@ public void TestDifficultyProcessingWhilePlaying() }); } + [TestCase(30000001)] [TestCase(30000002)] [TestCase(30000003)] + [TestCase(30000004)] + [TestCase(30000005)] public void TestScoreUpgradeSuccess(int scoreVersion) { ScoreInfo scoreInfo = null!; diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 33b66ecfc7..0d5cb84359 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -316,8 +316,7 @@ private void convertLegacyTotalScoreToStandardised() HashSet scoreIds = realmAccess.Run(r => new HashSet(r.All() .Where(s => !s.BackgroundReprocessingFailed && s.BeatmapInfo != null - && (s.TotalScoreVersion == 30000002 - || s.TotalScoreVersion == 30000003)) + && s.TotalScoreVersion < LegacyScoreEncoder.LATEST_VERSION) .AsEnumerable().Select(s => s.ID))); Logger.Log($"Found {scoreIds.Count} scores which require total score conversion."); diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index a30c40fdb0..6980e81f58 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -26,7 +26,7 @@ public static bool ShouldMigrateToNewStandardised(ScoreInfo score) if (score.IsLegacyScore) return false; - if (score.TotalScoreVersion > 30000004) + if (score.TotalScoreVersion > 30000005) return false; // Recalculate the old-style standardised score to see if this was an old lazer score.