1
0
mirror of synced 2025-01-19 08:07:24 +01:00

Fixed some score saving

This commit is contained in:
TLH 2022-08-27 18:45:41 +09:00
parent 42db23ce17
commit d130dba7f2
2 changed files with 13 additions and 4 deletions

View File

@ -59,9 +59,17 @@ public class BaidController:ControllerBase
userData = context.UserData.First(datum => datum.Baid == baid); userData = context.UserData.First(datum => datum.Baid == baid);
} }
var achievementDisplayDifficulty = userData.AchievementDisplayDifficulty == Difficulty.None ?
context.SongPlayData.Where(datum => datum.Crown >= CrownType.Clear).Any() ?
context.SongPlayData.Where(datum => datum.Crown >= CrownType.Clear).Max(datum => datum.Difficulty) :
Difficulty.Easy : userData.AchievementDisplayDifficulty;
var songBestData = context.SongBestData var songBestData = context.SongBestData
.Where(datum => datum.Baid == baid && .Where(datum => datum.Baid == baid &&
datum.Difficulty == userData.AchievementDisplayDifficulty); achievementDisplayDifficulty != Difficulty.UraOni ?
datum.Difficulty == achievementDisplayDifficulty :
datum.Difficulty == Difficulty.Oni || datum.Difficulty == Difficulty.UraOni);
var crownCount = new uint[3]; var crownCount = new uint[3];
foreach (var crownType in Enum.GetValues<CrownType>()) foreach (var crownType in Enum.GetValues<CrownType>())
{ {
@ -141,7 +149,7 @@ public class BaidController:ControllerBase
AryCrownCounts = crownCount, AryCrownCounts = crownCount,
AryScoreRankCounts = scoreRankCount, AryScoreRankCounts = scoreRankCount,
IsDispAchievementOn = userData.DisplayAchievement, IsDispAchievementOn = userData.DisplayAchievement,
DispAchievementType = (uint)userData.AchievementDisplayDifficulty, DispAchievementType = (uint)achievementDisplayDifficulty,
IsDispAchievementTypeSet = true, IsDispAchievementTypeSet = true,
LastPlayMode = 0, LastPlayMode = 0,
IsDispSouuchiOn = true, IsDispSouuchiOn = true,

View File

@ -116,7 +116,8 @@ public class PlayResultController : ControllerBase
ScoreRank = (ScoreRank)stageData.ScoreRank, ScoreRank = (ScoreRank)stageData.ScoreRank,
Skipped = stageData.IsSkipUse, Skipped = stageData.IsSkipUse,
SongId = stageData.SongNo, SongId = stageData.SongNo,
PlayTime = lastPlayDatetime PlayTime = lastPlayDatetime,
Difficulty = (Difficulty)stageData.Level
}; };
context.SongPlayData.Add(playData); context.SongPlayData.Add(playData);
} }