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 @@
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 @@ protected override ResultsScreen CreateResults(ScoreInfo score)
}
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)