1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 01:59:53 +08:00

Refuse to import scores specifying incompatible mods

Supersedes https://github.com/ppy/osu/pull/32817.

The messaging of the failure to the user is maybe not the cleanest, but
I'm not sure it's worth putting time in to improve it?
This commit is contained in:
Bartłomiej Dach
2025-04-17 10:10:07 +02:00
Unverified
parent 1fad2a8f2c
commit 485c3e8e53
+4
View File
@@ -17,6 +17,7 @@ using osu.Game.Scoring.Legacy;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Utils;
using Realms;
namespace osu.Game.Scoring
@@ -90,6 +91,9 @@ namespace osu.Game.Scoring
ArgumentNullException.ThrowIfNull(model.BeatmapInfo);
ArgumentNullException.ThrowIfNull(model.Ruleset);
if (!ModUtils.CheckCompatibleSet(model.Mods))
throw new InvalidOperationException(@"The score specifies an incompatible set of mods!");
if (string.IsNullOrEmpty(model.StatisticsJson))
model.StatisticsJson = JsonConvert.SerializeObject(model.Statistics);