diff --git a/GameDatabase/Context/TaikoDbContext.cs b/GameDatabase/Context/TaikoDbContext.cs index 2ea9f7e..7e95b79 100644 --- a/GameDatabase/Context/TaikoDbContext.cs +++ b/GameDatabase/Context/TaikoDbContext.cs @@ -1,4 +1,5 @@ -using GameDatabase.Entities; +using EntityFramework.Exceptions.Sqlite; +using GameDatabase.Entities; using Microsoft.EntityFrameworkCore; using SharedProject.Utils; @@ -40,6 +41,7 @@ namespace GameDatabase.Context path = dbFilePath; } optionsBuilder.UseSqlite($"Data Source={path}"); + optionsBuilder.UseExceptionProcessor().EnableSensitiveDataLogging(); } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/GameDatabase/GameDatabase.csproj b/GameDatabase/GameDatabase.csproj index 9cb07e7..e9c5cfc 100644 --- a/GameDatabase/GameDatabase.csproj +++ b/GameDatabase/GameDatabase.csproj @@ -12,7 +12,8 @@ - + + all diff --git a/LocalSaveModScoreMigrator/LocalSaveModScoreMigrator.csproj b/LocalSaveModScoreMigrator/LocalSaveModScoreMigrator.csproj index e11aede..6b4cbcf 100644 --- a/LocalSaveModScoreMigrator/LocalSaveModScoreMigrator.csproj +++ b/LocalSaveModScoreMigrator/LocalSaveModScoreMigrator.csproj @@ -11,7 +11,7 @@ - + all diff --git a/TaikoLocalServer/Handlers/AddTokenCountCommand.cs b/TaikoLocalServer/Handlers/AddTokenCountCommand.cs index 6b5ee0b..091a5aa 100644 --- a/TaikoLocalServer/Handlers/AddTokenCountCommand.cs +++ b/TaikoLocalServer/Handlers/AddTokenCountCommand.cs @@ -40,6 +40,7 @@ public class AddTokenCountCommandHandler : IRequestHandler { user.Tokens.Add(new Token { + Baid = user.Baid, Id = (int)tokenId, Count = addTokenCount }); diff --git a/TaikoLocalServer/Handlers/UpdatePlayResultCommand.cs b/TaikoLocalServer/Handlers/UpdatePlayResultCommand.cs index 330d7a8..66761d8 100644 --- a/TaikoLocalServer/Handlers/UpdatePlayResultCommand.cs +++ b/TaikoLocalServer/Handlers/UpdatePlayResultCommand.cs @@ -18,7 +18,7 @@ public class UpdatePlayResultCommandHandler(TaikoDbContext context, ILogger datum.AiSectionScoreData) .FirstOrDefaultAsync(datum => datum.Baid == playResultData.Baid && datum.SongId == stageData.SongNo && - datum.Difficulty == difficulty); + datum.Difficulty == difficulty) + ?? context.AiScoreData.Local.FirstOrDefault(datum => datum.Baid == playResultData.Baid && + datum.SongId == stageData.SongNo && + datum.Difficulty == difficulty); if (existing is null) { existing = new AiScoreDatum @@ -185,10 +181,8 @@ public class UpdatePlayResultCommandHandler(TaikoDbContext context, ILogger data.IsWin); - context.UserData.Update(user); } private static CrownType PlayResultToCrown(uint playResult, uint okCount) diff --git a/TaikoLocalServer/TaikoLocalServer.csproj b/TaikoLocalServer/TaikoLocalServer.csproj index 8cef3e0..c1167b1 100644 --- a/TaikoLocalServer/TaikoLocalServer.csproj +++ b/TaikoLocalServer/TaikoLocalServer.csproj @@ -17,7 +17,7 @@ - + all