mirror of
https://github.com/osukey/osukey.git
synced 2025-05-02 04:07:22 +09:00
Always submit standardised scores
This commit is contained in:
parent
c818e1cd83
commit
50b51a168e
@ -167,6 +167,8 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
score.Rank = Rank;
|
score.Rank = Rank;
|
||||||
score.Date = DateTimeOffset.Now;
|
score.Date = DateTimeOffset.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract double GetStandardisedScore();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScoreProcessor<TObject> : ScoreProcessor
|
public class ScoreProcessor<TObject> : ScoreProcessor
|
||||||
@ -340,18 +342,24 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (rollingMaxBaseScore != 0)
|
if (rollingMaxBaseScore != 0)
|
||||||
Accuracy.Value = baseScore / rollingMaxBaseScore;
|
Accuracy.Value = baseScore / rollingMaxBaseScore;
|
||||||
|
|
||||||
switch (Mode.Value)
|
TotalScore.Value = getScore(Mode.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getScore(ScoringMode mode)
|
||||||
{
|
{
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
default:
|
||||||
case ScoringMode.Standardised:
|
case ScoringMode.Standardised:
|
||||||
TotalScore.Value = max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
|
return max_score * (base_portion * baseScore / maxBaseScore + combo_portion * HighestCombo / maxHighestCombo) + bonusScore;
|
||||||
break;
|
|
||||||
case ScoringMode.Classic:
|
case ScoringMode.Classic:
|
||||||
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
|
// 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);
|
return bonusScore + baseScore * (1 + Math.Max(0, HighestCombo - 1) / 25);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override double GetStandardisedScore() => getScore(ScoringMode.Standardised);
|
||||||
|
|
||||||
protected override void Reset(bool storeResults)
|
protected override void Reset(bool storeResults)
|
||||||
{
|
{
|
||||||
if (storeResults)
|
if (storeResults)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -60,16 +61,22 @@ namespace osu.Game.Screens.Multi.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override ScoreInfo CreateScore()
|
protected override ScoreInfo CreateScore()
|
||||||
|
{
|
||||||
|
submitScore();
|
||||||
|
return base.CreateScore();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void submitScore()
|
||||||
{
|
{
|
||||||
var score = base.CreateScore();
|
var score = base.CreateScore();
|
||||||
|
|
||||||
|
score.TotalScore = (int)Math.Round(ScoreProcessor.GetStandardisedScore());
|
||||||
|
|
||||||
Debug.Assert(token != null);
|
Debug.Assert(token != null);
|
||||||
|
|
||||||
var request = new SubmitRoomScoreRequest(token.Value, room.RoomID.Value ?? 0, playlistItemId, score);
|
var request = new SubmitRoomScoreRequest(token.Value, room.RoomID.Value ?? 0, playlistItemId, score);
|
||||||
request.Failure += e => Logger.Error(e, "Failed to submit score");
|
request.Failure += e => Logger.Error(e, "Failed to submit score");
|
||||||
api.Queue(request);
|
api.Queue(request);
|
||||||
|
|
||||||
return score;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Results CreateResults(ScoreInfo score) => new MatchResults(score, room);
|
protected override Results CreateResults(ScoreInfo score) => new MatchResults(score, room);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user