1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 08:27:49 +08:00

Rename and adjust xmldoc on TotalScoreVersion

This commit is contained in:
Dean Herbert 2023-07-04 20:02:25 +09:00
parent aee89e5e4b
commit f2aa80f413
3 changed files with 17 additions and 15 deletions

View File

@ -204,7 +204,7 @@ namespace osu.Game
{
Logger.Log("Querying for scores that need total score conversion...");
HashSet<Guid> scoreIds = realmAccess.Run(r => new HashSet<Guid>(r.All<ScoreInfo>().Where(s => s.Version == 30000002).AsEnumerable().Select(s => s.ID)));
HashSet<Guid> scoreIds = realmAccess.Run(r => new HashSet<Guid>(r.All<ScoreInfo>().Where(s => s.TotalScoreVersion == 30000002).AsEnumerable().Select(s => s.ID)));
Logger.Log($"Found {scoreIds.Count} scores which require total score conversion.");
@ -239,7 +239,7 @@ namespace osu.Game
{
ScoreInfo s = r.Find<ScoreInfo>(id);
s.TotalScore = newTotalScore;
s.Version = LegacyScoreEncoder.LATEST_VERSION;
s.TotalScoreVersion = LegacyScoreEncoder.LATEST_VERSION;
});
Logger.Log($"Converted total score for score {id}");

View File

@ -975,13 +975,13 @@ namespace osu.Game.Database
if (score.IsLegacyScore && score.Ruleset.IsLegacyRuleset())
{
// Scores with this version will trigger the score upgrade process in BackgroundBeatmapProcessor.
score.Version = 30000002;
score.TotalScoreVersion = 30000002;
// Transfer known legacy scores to a permanent storage field for preservation.
score.LegacyTotalScore = score.TotalScore;
}
else
score.Version = LegacyScoreEncoder.LATEST_VERSION;
score.TotalScoreVersion = LegacyScoreEncoder.LATEST_VERSION;
}
break;

View File

@ -54,13 +54,25 @@ namespace osu.Game.Scoring
public long TotalScore { get; set; }
/// <summary>
/// The version of processing applied to calculate total score as stored in the database.
/// If this does not match <see cref="LegacyScoreEncoder.LATEST_VERSION"/>,
/// the total score has not yet been updated to reflect the current scoring values.
///
/// See <see cref="BackgroundBeatmapProcessor"/>'s conversion logic.
/// </summary>
/// <remarks>
/// This may not match the version stored in the replay files.
/// </remarks>
internal int TotalScoreVersion { get; set; } = LegacyScoreEncoder.LATEST_VERSION;
/// <summary>
/// Used to preserve the total score for legacy scores.
/// </summary>
/// <remarks>
/// Not populated if <see cref="IsLegacyScore"/> is <c>false</c>.
/// </remarks>
public long? LegacyTotalScore { get; set; }
internal long? LegacyTotalScore { get; set; }
public int MaxCombo { get; set; }
@ -72,16 +84,6 @@ namespace osu.Game.Scoring
public double? PP { get; set; }
/// <summary>
/// The version of this score as stored in the database.
/// If this does not match <see cref="LegacyScoreEncoder.LATEST_VERSION"/>,
/// then the score has not yet been updated to reflect the current scoring values.
/// </summary>
/// <remarks>
/// This may not match the version stored in the replay files.
/// </remarks>
public int Version { get; set; } = LegacyScoreEncoder.LATEST_VERSION;
[Indexed]
public long OnlineID { get; set; } = -1;