Send ScoreProcessor statistics in SpectatorState

This commit is contained in:
Dan Balasescu
2022-05-30 19:14:03 +09:00
parent c97b477485
commit a052e09ac3
5 changed files with 61 additions and 33 deletions

View File

@ -172,6 +172,9 @@ namespace osu.Game.Online.Spectator
currentState.RulesetID = score.ScoreInfo.RulesetID;
currentState.Mods = score.ScoreInfo.Mods.Select(m => new APIMod(m)).ToArray();
currentState.State = SpectatedUserState.Playing;
currentState.MaxAchievableCombo = state.ScoreProcessor.MaxAchievableCombo;
currentState.MaxAchievableBaseScore = state.ScoreProcessor.MaxAchievableBaseScore;
currentState.TotalBasicHitObjects = state.ScoreProcessor.TotalBasicHitObjects;
currentBeatmap = state.Beatmap;
currentScore = score;

View File

@ -27,6 +27,24 @@ namespace osu.Game.Online.Spectator
[Key(3)]
public SpectatedUserState State { get; set; }
/// <summary>
/// The maximum achievable combo, if everything is hit perfectly.
/// </summary>
[Key(4)]
public int MaxAchievableCombo { get; set; }
/// <summary>
/// The maximum achievable base score, if everything is hit perfectly.
/// </summary>
[Key(5)]
public double MaxAchievableBaseScore { get; set; }
/// <summary>
/// The total number of basic (non-tick and non-bonus) hitobjects that can be hit.
/// </summary>
[Key(6)]
public int TotalBasicHitObjects { get; set; }
public bool Equals(SpectatorState other)
{
if (ReferenceEquals(null, other)) return false;