1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Skip saving user settings when in dan mode

This commit is contained in:
asesidaa 2022-09-18 00:42:50 +08:00
parent 78989cb820
commit d474416037

View File

@ -182,6 +182,8 @@ public class PlayResultController : BaseController<PlayResultController>
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<uint>
@ -194,12 +196,16 @@ public class PlayResultController : BaseController<PlayResultController>
};
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;