Various updates to ruleset and primary key usages to move closer to realm support

This commit is contained in:
Dean Herbert
2021-11-24 12:16:08 +09:00
parent b77bb2f12b
commit b8cd3cdbbc
22 changed files with 64 additions and 73 deletions

View File

@ -226,8 +226,8 @@ namespace osu.Game.Screens.Play
// ensure the score is in a consistent state with the current player.
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
if (ruleset.RulesetInfo.ID != null)
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.ID.Value;
if (ruleset.RulesetInfo.OnlineID >= 0)
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.OnlineID;
Score.ScoreInfo.Mods = gameplayMods;
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score));
@ -488,6 +488,9 @@ namespace osu.Game.Screens.Play
var rulesetInfo = Ruleset.Value ?? Beatmap.Value.BeatmapInfo.Ruleset;
ruleset = rulesetInfo.CreateInstance();
if (ruleset == null)
throw new RulesetLoadException("Instantiation failure");
try
{
playable = Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo, gameplayMods);