Fix several missing properties on `MultiplayerScore`

You wouldn't think this would be an actual thing that can happen to us,
but it is. The most important one by far is `MaximumStatistics`; that
is the root cause behind why stuff like spinner ticks or slider tails
wasn't showing.

On a better day we should probably do cleanup to unify these models
better, but today is not that day.
This commit is contained in:
Bartłomiej Dach 2024-07-25 13:06:18 +02:00
parent 9790c5a574
commit 3bb30d7ff9
No known key found for this signature in database
1 changed files with 13 additions and 0 deletions

View File

@ -46,6 +46,9 @@ public class MultiplayerScore
[JsonProperty("statistics")]
public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>();
[JsonProperty("maximum_statistics")]
public Dictionary<HitResult, int> MaximumStatistics = new Dictionary<HitResult, int>();
[JsonProperty("passed")]
public bool Passed { get; set; }
@ -58,9 +61,15 @@ public class MultiplayerScore
[JsonProperty("position")]
public int? Position { get; set; }
[JsonProperty("pp")]
public double? PP { get; set; }
[JsonProperty("has_replay")]
public bool HasReplay { get; set; }
[JsonProperty("ranked")]
public bool Ranked { get; set; }
/// <summary>
/// Any scores in the room around this score.
/// </summary>
@ -83,13 +92,17 @@ public ScoreInfo CreateScoreInfo(ScoreManager scoreManager, RulesetStore ruleset
MaxCombo = MaxCombo,
BeatmapInfo = beatmap,
Ruleset = rulesets.GetRuleset(playlistItem.RulesetID) ?? throw new InvalidOperationException($"Ruleset with ID of {playlistItem.RulesetID} not found locally"),
Passed = Passed,
Statistics = Statistics,
MaximumStatistics = MaximumStatistics,
User = User,
Accuracy = Accuracy,
Date = EndedAt,
HasOnlineReplay = HasReplay,
Rank = Rank,
Mods = Mods?.Select(m => m.ToMod(rulesetInstance)).ToArray() ?? Array.Empty<Mod>(),
PP = PP,
Ranked = Ranked,
Position = Position,
};