diff --git a/DragaliaAPI/DragaliaAPI.Test/Controllers/DungeonControllerTest.cs b/DragaliaAPI/DragaliaAPI.Test/Controllers/DungeonControllerTest.cs index d36145928..53fe80ee4 100644 --- a/DragaliaAPI/DragaliaAPI.Test/Controllers/DungeonControllerTest.cs +++ b/DragaliaAPI/DragaliaAPI.Test/Controllers/DungeonControllerTest.cs @@ -1,5 +1,6 @@ using DragaliaAPI.Features.Dungeon; using DragaliaAPI.Features.Dungeon.Record; +using DragaliaAPI.Features.Dungeon.Start; using DragaliaAPI.Features.Quest; using DragaliaAPI.Features.Reward; using DragaliaAPI.Models; @@ -8,6 +9,7 @@ using DragaliaAPI.Services.Photon; using DragaliaAPI.Shared.Definitions.Enums; using DragaliaAPI.Shared.MasterAsset; +using Microsoft.Extensions.Logging.Abstractions; namespace DragaliaAPI.Test.Controllers; @@ -40,7 +42,8 @@ public DungeonControllerTest() this.mockUpdateDataService.Object, this.mockRewardService.Object, this.mockMatchingService.Object, - this.mockDungeonRecordHelperService.Object + this.mockDungeonRecordHelperService.Object, + NullLogger.Instance ); } diff --git a/DragaliaAPI/DragaliaAPI/Features/Dungeon/DungeonController.cs b/DragaliaAPI/DragaliaAPI/Features/Dungeon/DungeonController.cs index c425fa27a..814bc722e 100644 --- a/DragaliaAPI/DragaliaAPI/Features/Dungeon/DungeonController.cs +++ b/DragaliaAPI/DragaliaAPI/Features/Dungeon/DungeonController.cs @@ -5,6 +5,7 @@ using DragaliaAPI.Models; using DragaliaAPI.Models.Generated; using DragaliaAPI.Services; +using DragaliaAPI.Services.Game; using DragaliaAPI.Services.Photon; using Microsoft.AspNetCore.Mvc; @@ -18,7 +19,8 @@ public class DungeonController( IUpdateDataService updateDataService, IRewardService rewardService, IMatchingService matchingService, - IDungeonRecordHelperService dungeonRecordHelperService + IDungeonRecordHelperService dungeonRecordHelperService, + ILogger logger ) : DragaliaControllerBase { [HttpPost("get_area_odds")] @@ -43,12 +45,12 @@ public async Task Fail(DungeonFailRequest request) { DungeonSession session = await dungeonService.FinishDungeon(request.DungeonKey); + logger.LogDebug("Processing fail request for quest {QuestId}", session.QuestId); + DungeonFailResponse response = new() { Result = 1, - FailHelperList = new List(), - FailHelperDetailList = new List(), FailQuestDetail = new() { QuestId = session.QuestId, @@ -58,6 +60,8 @@ public async Task Fail(DungeonFailRequest request) } }; + logger.LogDebug("Session is multiplayer: {IsMulti}", session.IsMulti); + if (session.IsMulti) { response.FailQuestDetail.IsHost = await matchingService.GetIsHost(); @@ -70,6 +74,8 @@ public async Task Fail(DungeonFailRequest request) await dungeonRecordHelperService.ProcessHelperDataSolo(session.SupportViewerId); } + logger.LogDebug("Final response: {@Response}", response); + return this.Ok(response); } diff --git a/DragaliaAPI/DragaliaAPI/Features/Dungeon/Start/DungeonStartController.cs b/DragaliaAPI/DragaliaAPI/Features/Dungeon/Start/DungeonStartController.cs index db11adef6..2ca8f88c4 100644 --- a/DragaliaAPI/DragaliaAPI/Features/Dungeon/Start/DungeonStartController.cs +++ b/DragaliaAPI/DragaliaAPI/Features/Dungeon/Start/DungeonStartController.cs @@ -29,6 +29,12 @@ public async Task Start( CancellationToken cancellationToken ) { + logger.LogDebug( + "Attempting to start quest {QuestId} with helper {SupportViewerId}", + request.QuestId, + request.SupportViewerId + ); + if (!await dungeonStartService.ValidateStamina(request.QuestId, StaminaType.Single)) return this.Code(ResultCode.QuestStaminaSingleShort);