mirror of
https://github.com/ppy/osu
synced 2025-03-31 23:58:37 +00:00
Merge pull request #12348 from peppy/fix-score-submission-ruleset-id-missing
Fix scores not being accepted due to missing ruleset ID
This commit is contained in:
commit
e3c75cd4aa
osu.Game
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Globalization;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
@ -11,11 +12,13 @@ namespace osu.Game.Online.Solo
|
|||||||
public class CreateSoloScoreRequest : APIRequest<APIScoreToken>
|
public class CreateSoloScoreRequest : APIRequest<APIScoreToken>
|
||||||
{
|
{
|
||||||
private readonly int beatmapId;
|
private readonly int beatmapId;
|
||||||
|
private readonly int rulesetId;
|
||||||
private readonly string versionHash;
|
private readonly string versionHash;
|
||||||
|
|
||||||
public CreateSoloScoreRequest(int beatmapId, string versionHash)
|
public CreateSoloScoreRequest(int beatmapId, int rulesetId, string versionHash)
|
||||||
{
|
{
|
||||||
this.beatmapId = beatmapId;
|
this.beatmapId = beatmapId;
|
||||||
|
this.rulesetId = rulesetId;
|
||||||
this.versionHash = versionHash;
|
this.versionHash = versionHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,6 +27,7 @@ namespace osu.Game.Online.Solo
|
|||||||
var req = base.CreateWebRequest();
|
var req = base.CreateWebRequest();
|
||||||
req.Method = HttpMethod.Post;
|
req.Method = HttpMethod.Post;
|
||||||
req.AddParameter("version_hash", versionHash);
|
req.AddParameter("version_hash", versionHash);
|
||||||
|
req.AddParameter("ruleset_id", rulesetId.ToString(CultureInfo.InvariantCulture));
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,10 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId))
|
if (!(Beatmap.Value.BeatmapInfo.OnlineBeatmapID is int beatmapId))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return new CreateSoloScoreRequest(beatmapId, Game.VersionHash);
|
if (!(Ruleset.Value.ID is int rulesetId))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new CreateSoloScoreRequest(beatmapId, rulesetId, Game.VersionHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool HandleTokenRetrievalFailure(Exception exception) => false;
|
protected override bool HandleTokenRetrievalFailure(Exception exception) => false;
|
||||||
|
Loading…
Reference in New Issue
Block a user