Fixed some score saving
This commit is contained in:
parent
42db23ce17
commit
d130dba7f2
@ -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,
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user