1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 01:20:21 +08:00

Merge pull request #19126 from peppy/lazer-leaderboards

Show leaderboard scores from new data source
This commit is contained in:
Dean Herbert
2022-07-16 01:53:16 +09:00
committed by GitHub
Unverified
8 changed files with 18 additions and 14 deletions
@@ -274,14 +274,18 @@ namespace osu.Game.Tests.Visual.Online
}
};
const int initial_great_count = 2000;
int greatCount = initial_great_count;
foreach (var s in scores.Scores)
{
s.Statistics = new Dictionary<HitResult, int>
{
{ HitResult.Great, RNG.Next(2000) },
{ HitResult.Ok, RNG.Next(2000) },
{ HitResult.Meh, RNG.Next(2000) },
{ HitResult.Miss, RNG.Next(2000) }
{ HitResult.Great, greatCount -= 100 },
{ HitResult.Ok, RNG.Next(100) },
{ HitResult.Meh, RNG.Next(100) },
{ HitResult.Miss, initial_great_count - greatCount }
};
}
-1
View File
@@ -443,7 +443,6 @@ namespace osu.Game.Database
TotalScore = score.TotalScore,
MaxCombo = score.MaxCombo,
Accuracy = score.Accuracy,
HasReplay = ((IScoreInfo)score).HasReplay,
Date = score.Date,
PP = score.PP,
Rank = score.Rank,
+2 -1
View File
@@ -59,8 +59,9 @@ namespace osu.Game.Database
/// 13 2022-01-13 Final migration of beatmaps and scores to realm (multiple new storage fields).
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
/// 16 2022-07-15 Removed HasReplay from ScoreInfo.
/// </summary>
private const int schema_version = 15;
private const int schema_version = 16;
/// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
@@ -35,7 +35,7 @@ namespace osu.Game.Online.API.Requests
this.mods = mods ?? Array.Empty<IMod>();
}
protected override string Target => $@"beatmaps/{beatmapInfo.OnlineID}/scores{createQueryParameters()}";
protected override string Target => $@"beatmaps/{beatmapInfo.OnlineID}/solo-scores{createQueryParameters()}";
private string createQueryParameters()
{
@@ -103,9 +103,6 @@ namespace osu.Game.Online.API.Requests.Responses
var mods = Mods.Select(apiMod => rulesetInstance.CreateModFromAcronym(apiMod.Acronym)).Where(m => m != null).ToArray();
// all API scores provided by this class are considered to be legacy.
mods = mods.Append(rulesetInstance.CreateMod<ModClassic>()).ToArray();
var scoreInfo = ToScoreInfo(mods);
scoreInfo.Ruleset = ruleset;
@@ -132,8 +129,7 @@ namespace osu.Game.Online.API.Requests.Responses
Rank = Rank,
Statistics = Statistics,
Date = EndedAt ?? DateTimeOffset.Now,
Hash = "online", // TODO: temporary?
HasReplay = HasReplay,
Hash = HasReplay ? "online" : string.Empty, // TODO: temporary?
Mods = mods,
PP = PP,
};
+1 -1
View File
@@ -45,7 +45,7 @@ namespace osu.Game.Scoring
public double Accuracy { get; set; }
public bool HasReplay { get; set; }
public bool HasReplay => !string.IsNullOrEmpty(Hash);
public DateTimeOffset Date { get; set; }
+4
View File
@@ -11,6 +11,10 @@ namespace osu.Game.Scoring
{
public enum ScoreRank
{
// TODO: Localisable?
[Description(@"F")]
F = -1,
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.RankD))]
[Description(@"D")]
D,
@@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
if (State.Value == DownloadState.LocallyAvailable)
return ReplayAvailability.Local;
if (!string.IsNullOrEmpty(Score.Value?.Hash))
if (Score.Value?.HasReplay == true)
return ReplayAvailability.Online;
return ReplayAvailability.NotAvailable;