diff --git a/osu.Game/Migrations/20181130084152_AddScoreInfoTables.Designer.cs b/osu.Game/Migrations/20181130113755_AddScoreInfoTables.Designer.cs similarity index 98% rename from osu.Game/Migrations/20181130084152_AddScoreInfoTables.Designer.cs rename to osu.Game/Migrations/20181130113755_AddScoreInfoTables.Designer.cs index 99833268f9..eee53182ce 100644 --- a/osu.Game/Migrations/20181130084152_AddScoreInfoTables.Designer.cs +++ b/osu.Game/Migrations/20181130113755_AddScoreInfoTables.Designer.cs @@ -9,7 +9,7 @@ using osu.Game.Database; namespace osu.Game.Migrations { [DbContext(typeof(OsuDbContext))] - [Migration("20181130084152_AddScoreInfoTables")] + [Migration("20181130113755_AddScoreInfoTables")] partial class AddScoreInfoTables { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -309,7 +309,8 @@ namespace osu.Game.Migrations b.Property("ID") .ValueGeneratedOnAdd(); - b.Property("Accuracy"); + b.Property("Accuracy") + .HasColumnType("DECIMAL(1,4)"); b.Property("BeatmapInfoID"); @@ -321,8 +322,6 @@ namespace osu.Game.Migrations b.Property("Hash"); - b.Property("Health"); - b.Property("MaxCombo"); b.Property("ModsJson") @@ -339,7 +338,7 @@ namespace osu.Game.Migrations b.Property("StatisticsJson") .HasColumnName("Statistics"); - b.Property("TotalScore"); + b.Property("TotalScore"); b.Property("UserString") .HasColumnName("User"); diff --git a/osu.Game/Migrations/20181130084152_AddScoreInfoTables.cs b/osu.Game/Migrations/20181130113755_AddScoreInfoTables.cs similarity index 95% rename from osu.Game/Migrations/20181130084152_AddScoreInfoTables.cs rename to osu.Game/Migrations/20181130113755_AddScoreInfoTables.cs index e45776abca..2b6f94c5a4 100644 --- a/osu.Game/Migrations/20181130084152_AddScoreInfoTables.cs +++ b/osu.Game/Migrations/20181130113755_AddScoreInfoTables.cs @@ -14,9 +14,8 @@ namespace osu.Game.Migrations ID = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Rank = table.Column(nullable: false), - TotalScore = table.Column(nullable: false), - Accuracy = table.Column(nullable: false), - Health = table.Column(nullable: false), + TotalScore = table.Column(nullable: false), + Accuracy = table.Column(type: "DECIMAL(1,4)", nullable: false), PP = table.Column(nullable: true), MaxCombo = table.Column(nullable: false), Combo = table.Column(nullable: false), diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index a88dfc4a46..8026847e3b 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -307,7 +307,8 @@ namespace osu.Game.Migrations b.Property("ID") .ValueGeneratedOnAdd(); - b.Property("Accuracy"); + b.Property("Accuracy") + .HasColumnType("DECIMAL(1,4)"); b.Property("BeatmapInfoID"); @@ -319,8 +320,6 @@ namespace osu.Game.Migrations b.Property("Hash"); - b.Property("Health"); - b.Property("MaxCombo"); b.Property("ModsJson") @@ -337,7 +336,7 @@ namespace osu.Game.Migrations b.Property("StatisticsJson") .HasColumnName("Statistics"); - b.Property("TotalScore"); + b.Property("TotalScore"); b.Property("UserString") .HasColumnName("User"); diff --git a/osu.Game/Online/API/Requests/Responses/APIScoreInfo.cs b/osu.Game/Online/API/Requests/Responses/APIScoreInfo.cs index de7038cbde..838c4f95e4 100644 --- a/osu.Game/Online/API/Requests/Responses/APIScoreInfo.cs +++ b/osu.Game/Online/API/Requests/Responses/APIScoreInfo.cs @@ -16,7 +16,7 @@ namespace osu.Game.Online.API.Requests.Responses public class APIScoreInfo : ScoreInfo { [JsonProperty(@"score")] - private double totalScore + private int totalScore { set => TotalScore = value; } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 830f13ad6d..3b1964c425 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -160,10 +160,10 @@ namespace osu.Game.Rulesets.Scoring /// public virtual void PopulateScore(ScoreInfo score) { - score.TotalScore = TotalScore; + score.TotalScore = (int)Math.Round(TotalScore); score.Combo = Combo; score.MaxCombo = HighestCombo; - score.Accuracy = Accuracy; + score.Accuracy = Math.Round(Accuracy, 4); score.Rank = Rank; score.Date = DateTimeOffset.Now; score.Health = Health; diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 1ca62471f4..669209a4e8 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -21,10 +21,12 @@ namespace osu.Game.Scoring public ScoreRank Rank { get; set; } - public double TotalScore { get; set; } + public int TotalScore { get; set; } + [Column(TypeName="DECIMAL(1,4)")] public double Accuracy { get; set; } + [NotMapped] public double Health { get; set; } = 1; public double? PP { get; set; }