From d47441603718df6f4c14daa56044938392a4ed58 Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Sun, 18 Sep 2022 00:42:50 +0800 Subject: [PATCH] Skip saving user settings when in dan mode --- .../Controllers/Game/PlayResultController.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/TaikoLocalServer/Controllers/Game/PlayResultController.cs b/TaikoLocalServer/Controllers/Game/PlayResultController.cs index a767160..5b880e4 100644 --- a/TaikoLocalServer/Controllers/Game/PlayResultController.cs +++ b/TaikoLocalServer/Controllers/Game/PlayResultController.cs @@ -182,6 +182,8 @@ public class PlayResultController : BaseController userdata.ThrowIfNull($"User data is null! Baid: {request.BaidConf}"); + var playMode = (PlayMode)playResultData.PlayMode; + userdata.Title = playResultData.Title; userdata.TitlePlateId = playResultData.TitleplateId; var costumeData = new List @@ -194,12 +196,16 @@ public class PlayResultController : BaseController }; userdata.CostumeData = JsonSerializer.Serialize(costumeData); - var lastStage = playResultData.AryStageInfoes.Last(); - var option = BinaryPrimitives.ReadInt16LittleEndian(lastStage.OptionFlg); - userdata.OptionSetting = option; - userdata.IsSkipOn = lastStage.IsSkipOn; - userdata.IsVoiceOn = lastStage.IsVoiceOn; - userdata.NotesPosition = lastStage.NotesPosition; + // Skip user setting saving when in dan mode as dan mode uses its own default setting + if (playMode != PlayMode.DanMode) + { + var lastStage = playResultData.AryStageInfoes.Last(); + var option = BinaryPrimitives.ReadInt16LittleEndian(lastStage.OptionFlg); + userdata.OptionSetting = option; + userdata.IsSkipOn = lastStage.IsSkipOn; + userdata.IsVoiceOn = lastStage.IsVoiceOn; + userdata.NotesPosition = lastStage.NotesPosition; + } userdata.LastPlayDatetime = lastPlayDatetime; userdata.LastPlayMode = playResultData.PlayMode;