1
0
mirror of synced 2024-11-30 17:24:33 +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, Normal = 0,
DanMode = 1, DanMode = 1,
// Not sure about this GaidenMode = 4,
AiBattle = 6 AiBattle = 6
} }

View File

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

View File

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