1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 21:32:57 +08:00

Merge pull request #15430 from bdach/fix-multi-submission

Fix multiplayer score submission not working
This commit is contained in:
Dean Herbert 2021-11-03 04:10:23 +09:00 committed by GitHub
commit f67f42dc5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ using System.Net.Http;
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Framework.IO.Network; using osu.Framework.IO.Network;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.Solo;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Online.Rooms namespace osu.Game.Online.Rooms
@ -14,14 +15,14 @@ namespace osu.Game.Online.Rooms
private readonly long scoreId; private readonly long scoreId;
private readonly long roomId; private readonly long roomId;
private readonly long playlistItemId; private readonly long playlistItemId;
private readonly ScoreInfo scoreInfo; private readonly SubmittableScore score;
public SubmitRoomScoreRequest(long scoreId, long roomId, long playlistItemId, ScoreInfo scoreInfo) public SubmitRoomScoreRequest(long scoreId, long roomId, long playlistItemId, ScoreInfo scoreInfo)
{ {
this.scoreId = scoreId; this.scoreId = scoreId;
this.roomId = roomId; this.roomId = roomId;
this.playlistItemId = playlistItemId; this.playlistItemId = playlistItemId;
this.scoreInfo = scoreInfo; score = new SubmittableScore(scoreInfo);
} }
protected override WebRequest CreateWebRequest() protected override WebRequest CreateWebRequest()
@ -31,7 +32,7 @@ namespace osu.Game.Online.Rooms
req.ContentType = "application/json"; req.ContentType = "application/json";
req.Method = HttpMethod.Put; req.Method = HttpMethod.Put;
req.AddRaw(JsonConvert.SerializeObject(scoreInfo, new JsonSerializerSettings req.AddRaw(JsonConvert.SerializeObject(score, new JsonSerializerSettings
{ {
ReferenceLoopHandling = ReferenceLoopHandling.Ignore ReferenceLoopHandling = ReferenceLoopHandling.Ignore
})); }));