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

Merge pull request #3932 from smoogipoo/fix-scoring

Always submit standardised scores
This commit is contained in:
Dean Herbert 2018-12-27 21:30:37 +09:00 committed by GitHub
commit 82db1a2924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 7 deletions

View File

@ -167,6 +167,8 @@ namespace osu.Game.Rulesets.Scoring
score.Rank = Rank;
score.Date = DateTimeOffset.Now;
}
public abstract double GetStandardisedScore();
}
public class ScoreProcessor<TObject> : ScoreProcessor
@ -340,18 +342,24 @@ namespace osu.Game.Rulesets.Scoring
if (rollingMaxBaseScore != 0)
Accuracy.Value = baseScore / rollingMaxBaseScore;
switch (Mode.Value)
TotalScore.Value = getScore(Mode.Value);
}
private double getScore(ScoringMode mode)
{
switch (mode)
{
default:
case ScoringMode.Standardised:
TotalScore.Value = max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
break;
return max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
case ScoringMode.Classic:
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
TotalScore.Value = bonusScore + baseScore * (1 + Math.Max(0, HighestCombo - 1) / 25);
break;
return bonusScore + baseScore * (1 + Math.Max(0, HighestCombo - 1) / 25);
}
}
public override double GetStandardisedScore() => getScore(ScoringMode.Standardised);
protected override void Reset(bool storeResults)
{
if (storeResults)

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Diagnostics;
using System.Threading;
using osu.Framework.Allocation;
@ -60,16 +61,22 @@ 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, room.RoomID.Value ?? 0, playlistItemId, score);
request.Failure += e => Logger.Error(e, "Failed to submit score");
api.Queue(request);
return score;
}
protected override Results CreateResults(ScoreInfo score) => new MatchResults(score, room);