Enable saving gaiden play result
This commit is contained in:
parent
c963809be6
commit
9ca00e038b
@ -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
|
||||||
}
|
}
|
@ -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,
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user