Reformat
This commit is contained in:
parent
e55230dc91
commit
a5d2db22cc
@ -26,6 +26,7 @@ namespace GameDatabase.Context
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var path = Path.Combine(PathHelper.GetRootPath(), "taiko.db3");
|
var path = Path.Combine(PathHelper.GetRootPath(), "taiko.db3");
|
||||||
optionsBuilder.UseSqlite($"Data Source={path}");
|
optionsBuilder.UseSqlite($"Data Source={path}");
|
||||||
}
|
}
|
||||||
@ -54,10 +55,10 @@ namespace GameDatabase.Context
|
|||||||
|
|
||||||
entity.Property(e => e.Difficulty)
|
entity.Property(e => e.Difficulty)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
|
|
||||||
entity.Property(e => e.BestCrown)
|
entity.Property(e => e.BestCrown)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
|
|
||||||
entity.Property(e => e.BestScoreRank)
|
entity.Property(e => e.BestScoreRank)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
});
|
});
|
||||||
@ -75,13 +76,13 @@ namespace GameDatabase.Context
|
|||||||
.HasPrincipalKey(p => p.Baid)
|
.HasPrincipalKey(p => p.Baid)
|
||||||
.HasForeignKey(d => d.Baid)
|
.HasForeignKey(d => d.Baid)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
entity.Property(e => e.Difficulty)
|
entity.Property(e => e.Difficulty)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
|
|
||||||
entity.Property(e => e.ScoreRank)
|
entity.Property(e => e.ScoreRank)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
|
|
||||||
entity.Property(e => e.Crown)
|
entity.Property(e => e.Crown)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
});
|
});
|
||||||
@ -97,7 +98,7 @@ namespace GameDatabase.Context
|
|||||||
.HasPrincipalKey(p => p.Baid)
|
.HasPrincipalKey(p => p.Baid)
|
||||||
.HasForeignKey(d => d.Baid)
|
.HasForeignKey(d => d.Baid)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
entity.Property(e => e.AchievementDisplayDifficulty)
|
entity.Property(e => e.AchievementDisplayDifficulty)
|
||||||
.HasConversion<uint>();
|
.HasConversion<uint>();
|
||||||
});
|
});
|
||||||
@ -107,4 +108,4 @@ namespace GameDatabase.Context
|
|||||||
|
|
||||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -32,8 +32,8 @@ public partial class TaikoDbContext
|
|||||||
|
|
||||||
entity.HasOne(d => d.Parent)
|
entity.HasOne(d => d.Parent)
|
||||||
.WithMany(p => p.DanStageScoreData)
|
.WithMany(p => p.DanStageScoreData)
|
||||||
.HasPrincipalKey(p => new {p.Baid, p.DanId})
|
.HasPrincipalKey(p => new { p.Baid, p.DanId })
|
||||||
.HasForeignKey(d => new {d.Baid, d.DanId})
|
.HasForeignKey(d => new { d.Baid, d.DanId })
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -47,16 +47,16 @@ public partial class TaikoDbContext
|
|||||||
.HasForeignKey(d => d.Baid)
|
.HasForeignKey(d => d.Baid)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<AiSectionScoreDatum>(entity =>
|
modelBuilder.Entity<AiSectionScoreDatum>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => new { e.Baid, e.SongId, e.Difficulty, e.SectionIndex });
|
entity.HasKey(e => new { e.Baid, e.SongId, e.Difficulty, e.SectionIndex });
|
||||||
|
|
||||||
entity.HasOne(d => d.Parent)
|
entity.HasOne(d => d.Parent)
|
||||||
.WithMany(p => p.AiSectionScoreData)
|
.WithMany(p => p.AiSectionScoreData)
|
||||||
.HasPrincipalKey(p => new {p.Baid, p.SongId, p.Difficulty })
|
.HasPrincipalKey(p => new { p.Baid, p.SongId, p.Difficulty })
|
||||||
.HasForeignKey(d => new {d.Baid, d.SongId, d.Difficulty })
|
.HasForeignKey(d => new { d.Baid, d.SongId, d.Difficulty })
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,14 @@ namespace GameDatabase.Entities;
|
|||||||
public class AiScoreDatum
|
public class AiScoreDatum
|
||||||
{
|
{
|
||||||
public uint Baid { get; set; }
|
public uint Baid { get; set; }
|
||||||
|
|
||||||
public uint SongId { get; set; }
|
public uint SongId { get; set; }
|
||||||
|
|
||||||
public Difficulty Difficulty { get; set; }
|
public Difficulty Difficulty { get; set; }
|
||||||
|
|
||||||
public bool IsWin { get; set; }
|
public bool IsWin { get; set; }
|
||||||
|
|
||||||
public List<AiSectionScoreDatum> AiSectionScoreData { get; set; } = new();
|
public List<AiSectionScoreDatum> AiSectionScoreData { get; set; } = new();
|
||||||
|
|
||||||
public virtual Card? Ba { get; set; }
|
public virtual Card? Ba { get; set; }
|
||||||
}
|
}
|
@ -5,23 +5,23 @@ namespace GameDatabase.Entities;
|
|||||||
public class AiSectionScoreDatum
|
public class AiSectionScoreDatum
|
||||||
{
|
{
|
||||||
public uint Baid { get; set; }
|
public uint Baid { get; set; }
|
||||||
|
|
||||||
public uint SongId { get; set; }
|
public uint SongId { get; set; }
|
||||||
|
|
||||||
public Difficulty Difficulty { get; set; }
|
public Difficulty Difficulty { get; set; }
|
||||||
|
|
||||||
public int SectionIndex { get; set; }
|
public int SectionIndex { get; set; }
|
||||||
|
|
||||||
public CrownType Crown { get; set; }
|
public CrownType Crown { get; set; }
|
||||||
|
|
||||||
public bool IsWin { get; set; }
|
public bool IsWin { get; set; }
|
||||||
|
|
||||||
public uint Score { get; set; }
|
public uint Score { get; set; }
|
||||||
|
|
||||||
public uint GoodCount { get; set; }
|
public uint GoodCount { get; set; }
|
||||||
|
|
||||||
public uint OkCount { get; set; }
|
public uint OkCount { get; set; }
|
||||||
|
|
||||||
public uint MissCount { get; set; }
|
public uint MissCount { get; set; }
|
||||||
|
|
||||||
public uint DrumrollCount { get; set; }
|
public uint DrumrollCount { get; set; }
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
public string AccessCode { get; set; } = null!;
|
public string AccessCode { get; set; } = null!;
|
||||||
public uint Baid { get; set; }
|
public uint Baid { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,6 +11,6 @@ public class DanScoreDatum
|
|||||||
public uint ComboCountTotal { get; set; }
|
public uint ComboCountTotal { get; set; }
|
||||||
public DanClearState ClearState { get; set; }
|
public DanClearState ClearState { get; set; }
|
||||||
public List<DanStageScoreDatum> DanStageScoreData { get; set; } = new();
|
public List<DanStageScoreDatum> DanStageScoreData { get; set; } = new();
|
||||||
|
|
||||||
public virtual Card? Ba { get; set; }
|
public virtual Card? Ba { get; set; }
|
||||||
}
|
}
|
@ -3,25 +3,25 @@
|
|||||||
public class DanStageScoreDatum
|
public class DanStageScoreDatum
|
||||||
{
|
{
|
||||||
public uint Baid { get; set; }
|
public uint Baid { get; set; }
|
||||||
|
|
||||||
public uint DanId { get; set; }
|
public uint DanId { get; set; }
|
||||||
|
|
||||||
public uint SongNumber { get; set; }
|
public uint SongNumber { get; set; }
|
||||||
|
|
||||||
public uint PlayScore { get; set; }
|
public uint PlayScore { get; set; }
|
||||||
|
|
||||||
public uint GoodCount { get; set; }
|
public uint GoodCount { get; set; }
|
||||||
|
|
||||||
public uint OkCount { get; set; }
|
public uint OkCount { get; set; }
|
||||||
|
|
||||||
public uint BadCount { get; set; }
|
public uint BadCount { get; set; }
|
||||||
|
|
||||||
public uint DrumrollCount { get; set; }
|
public uint DrumrollCount { get; set; }
|
||||||
|
|
||||||
public uint TotalHitCount { get; set; }
|
public uint TotalHitCount { get; set; }
|
||||||
|
|
||||||
public uint ComboCount { get; set; }
|
public uint ComboCount { get; set; }
|
||||||
|
|
||||||
public uint HighScore { get; set; }
|
public uint HighScore { get; set; }
|
||||||
|
|
||||||
public DanScoreDatum Parent { get; set; } = null!;
|
public DanScoreDatum Parent { get; set; } = null!;
|
||||||
|
@ -14,4 +14,4 @@ namespace GameDatabase.Entities
|
|||||||
|
|
||||||
public virtual Card? Ba { get; set; }
|
public virtual Card? Ba { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,17 +10,17 @@ public partial class SongBestDatum
|
|||||||
{
|
{
|
||||||
BestCrown = crown;
|
BestCrown = crown;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((uint)BestScoreRank < scoreRank)
|
if ((uint)BestScoreRank < scoreRank)
|
||||||
{
|
{
|
||||||
BestScoreRank = (ScoreRank)scoreRank;
|
BestScoreRank = (ScoreRank)scoreRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BestScore < playScore)
|
if (BestScore < playScore)
|
||||||
{
|
{
|
||||||
BestScore = playScore;
|
BestScore = playScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BestRate < scoreRate)
|
if (BestRate < scoreRate)
|
||||||
{
|
{
|
||||||
BestRate = scoreRate;
|
BestRate = scoreRate;
|
||||||
|
@ -6,9 +6,9 @@ namespace GameDatabase.Entities
|
|||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint Baid { get; set; }
|
public uint Baid { get; set; }
|
||||||
|
|
||||||
public uint SongNumber { get; set; }
|
public uint SongNumber { get; set; }
|
||||||
|
|
||||||
public uint SongId { get; set; }
|
public uint SongId { get; set; }
|
||||||
public Difficulty Difficulty { get; set; }
|
public Difficulty Difficulty { get; set; }
|
||||||
public CrownType Crown { get; set; }
|
public CrownType Crown { get; set; }
|
||||||
@ -26,4 +26,4 @@ namespace GameDatabase.Entities
|
|||||||
|
|
||||||
public virtual Card? Ba { get; set; }
|
public virtual Card? Ba { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -31,4 +31,4 @@ namespace GameDatabase.Entities
|
|||||||
public int AiWinCount { get; set; }
|
public int AiWinCount { get; set; }
|
||||||
public virtual Card? Ba { get; set; }
|
public virtual Card? Ba { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,7 +10,8 @@ public class DateTimeConverter : JsonConverter<DateTime>
|
|||||||
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||||
{
|
{
|
||||||
Debug.Assert(typeToConvert == typeof(DateTime));
|
Debug.Assert(typeToConvert == typeof(DateTime));
|
||||||
var dateTime = DateTime.ParseExact(reader.GetString() ?? string.Empty, "dd_MM_yy-HH_mm_ss", CultureInfo.InvariantCulture);
|
var dateTime = DateTime.ParseExact(reader.GetString() ?? string.Empty, "dd_MM_yy-HH_mm_ss",
|
||||||
|
CultureInfo.InvariantCulture);
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,5 @@ namespace LocalSaveModScoreMigrator;
|
|||||||
|
|
||||||
public class MusicInfo
|
public class MusicInfo
|
||||||
{
|
{
|
||||||
[JsonPropertyName("items")]
|
[JsonPropertyName("items")] public List<MusicInfoEntry> Items { get; set; } = new();
|
||||||
public List<MusicInfoEntry> Items { get; set; } = new();
|
|
||||||
}
|
}
|
@ -4,9 +4,7 @@ namespace LocalSaveModScoreMigrator;
|
|||||||
|
|
||||||
public class MusicInfoEntry
|
public class MusicInfoEntry
|
||||||
{
|
{
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty;
|
||||||
public string Id { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[JsonPropertyName("uniqueId")]
|
[JsonPropertyName("uniqueId")] public uint SongId { get; set; }
|
||||||
public uint SongId { get; set; }
|
|
||||||
}
|
}
|
@ -7,14 +7,12 @@ public class PlayRecordJson
|
|||||||
{
|
{
|
||||||
public string SongId { get; set; } = "tmap4";
|
public string SongId { get; set; } = "tmap4";
|
||||||
public Difficulty Difficulty { get; set; }
|
public Difficulty Difficulty { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("dateTime")]
|
[JsonPropertyName("dateTime")] public DateTime DateTime { get; set; }
|
||||||
public DateTime DateTime { get; set; }
|
|
||||||
public uint Score { set; get; }
|
public uint Score { set; get; }
|
||||||
public CrownType Crown { get; set; }
|
public CrownType Crown { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("scorerank")]
|
[JsonPropertyName("scorerank")] public ScoreRank Scorerank { get; set; }
|
||||||
public ScoreRank Scorerank { get; set; }
|
|
||||||
public uint Good { get; set; }
|
public uint Good { get; set; }
|
||||||
public uint Ok { get; set; }
|
public uint Ok { get; set; }
|
||||||
public uint Bad { get; set; }
|
public uint Bad { get; set; }
|
||||||
|
@ -61,8 +61,8 @@ foreach (var playRecord in playRecordJson)
|
|||||||
SongId = songId
|
SongId = songId
|
||||||
};
|
};
|
||||||
db.SongPlayData.Add(playLog);
|
db.SongPlayData.Add(playLog);
|
||||||
|
|
||||||
|
|
||||||
var best = new SongBestDatum
|
var best = new SongBestDatum
|
||||||
{
|
{
|
||||||
Baid = user.Baid,
|
Baid = user.Baid,
|
||||||
|
Loading…
Reference in New Issue
Block a user