1
0
mirror of synced 2024-11-27 16:10:53 +01:00

Enable saving gaiden play result

This commit is contained in:
S-Sebb 2023-10-15 23:11:44 +01:00
parent c963809be6
commit 9ca00e038b
3 changed files with 9 additions and 3 deletions

View File

@ -4,6 +4,6 @@ public enum PlayMode
{
Normal = 0,
DanMode = 1,
// Not sure about this
GaidenMode = 4,
AiBattle = 6
}

View File

@ -1,5 +1,6 @@
using GameDatabase.Entities;
using System.Text.Json;
using Serilog;
using Throw;
namespace TaikoLocalServer.Controllers.Game;
@ -97,6 +98,11 @@ public class BaidController : BaseController<BaidController>
var danIdList = danDataDictionary.Keys.ToList();
var gotDanFlagArray = FlagCalculator.ComputeGotDanFlags(danData, danIdList);
var gaidenDataDictionary = gameDataService.GetGaidenDataDictionary();
var gaidenIdList = gaidenDataDictionary.Keys.ToList();
danIdList.AddRange(gaidenIdList);
var gotGaidenFlagArray = FlagCalculator.ComputeGotDanFlags(danData, danIdList);
var genericInfoFlg = Array.Empty<uint>();
try
{
@ -148,7 +154,7 @@ public class BaidController : BaseController<BaidController>
IsDispDanOn = userData.DisplayDan,
GotDanMax = maxDan,
GotDanFlg = gotDanFlagArray,
GotDanextraFlg = new byte[20],
GotDanextraFlg = gotGaidenFlagArray,
DefaultToneSetting = userData.SelectedToneId,
GenericInfoFlg = genericInfoFlgArray,
AryCrownCounts = crownCount,

View File

@ -71,7 +71,7 @@ public class PlayResultController : BaseController<PlayResultController>
var playMode = (PlayMode)playResultData.PlayMode;
if (playMode == PlayMode.DanMode)
if (playMode is PlayMode.DanMode or PlayMode.GaidenMode)
{
await UpdateDanPlayData(request, playResultData);
return Ok(response);