1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Fix duplicate scores showing

This commit is contained in:
smoogipoo 2020-06-09 18:21:37 +09:00
parent 7f05c16c9f
commit 44dd7d65be
2 changed files with 4 additions and 8 deletions

View File

@ -8,7 +8,7 @@ using osu.Game.Scoring;
namespace osu.Game.Online.API.Requests
{
public class SubmitRoomScoreRequest : APIRequest
public class SubmitRoomScoreRequest : APIRequest<RoomScore>
{
private readonly int scoreId;
private readonly int roomId;

View File

@ -97,22 +97,18 @@ namespace osu.Game.Screens.Multi.Play
}
protected override ScoreInfo CreateScore()
{
submitScore();
return base.CreateScore();
}
private void submitScore()
{
var score = base.CreateScore();
score.TotalScore = (int)Math.Round(ScoreProcessor.GetStandardisedScore());
Debug.Assert(token != null);
var request = new SubmitRoomScoreRequest(token.Value, roomId.Value ?? 0, playlistItem.ID, score);
request.Success += s => score.OnlineScoreID = s.ID;
request.Failure += e => Logger.Error(e, "Failed to submit score");
api.Queue(request);
return score;
}
protected override void Dispose(bool isDisposing)