Fix multiple issues with json serialisation of online info (causing tournament failures)

This commit is contained in:
Dean Herbert 2021-10-25 16:44:52 +09:00
parent 4dafe666ba
commit 6adb0f068b
3 changed files with 6 additions and 3 deletions

View File

@ -161,7 +161,7 @@ namespace osu.Game.Tournament.Tests
Artist = "Test Artist",
ID = RNG.Next(0, 1000000)
},
OnlineInfo = new BeatmapOnlineInfo(),
OnlineInfo = new APIBeatmap(),
};
protected override ITestSceneTestRunner CreateRunner() => new TournamentTestSceneTestRunner();

View File

@ -9,6 +9,7 @@ using System.Linq;
using Newtonsoft.Json;
using osu.Framework.Testing;
using osu.Game.Database;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osu.Game.Scoring;
@ -47,7 +48,7 @@ namespace osu.Game.Beatmaps
public BeatmapDifficulty BaseDifficulty { get; set; }
[NotMapped]
public IBeatmapOnlineInfo OnlineInfo { get; set; }
public APIBeatmap OnlineInfo { get; set; }
[NotMapped]
public int? MaxCombo { get; set; }

View File

@ -74,6 +74,8 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"max_combo")]
public int? MaxCombo { get; set; }
public double BPM { get; set; }
public virtual BeatmapInfo ToBeatmapInfo(RulesetStore rulesets)
{
var set = BeatmapSet?.ToBeatmapSet(rulesets);
@ -120,7 +122,7 @@ namespace osu.Game.Online.API.Requests.Responses
public IRulesetInfo Ruleset => new RulesetInfo { ID = RulesetID };
public double BPM => throw new NotImplementedException();
[JsonIgnore]
public string Hash => throw new NotImplementedException();
#endregion