From 6d953b20cc7acd5c65ccc0968bca4ae76f506173 Mon Sep 17 00:00:00 2001 From: moonheart Date: Sun, 19 May 2024 18:15:58 +0800 Subject: [PATCH] can not reward multiple panel mission --- MementoMori/MementoMoriFuncs.Ops.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/MementoMori/MementoMoriFuncs.Ops.cs b/MementoMori/MementoMoriFuncs.Ops.cs index cd49613..f080874 100644 --- a/MementoMori/MementoMoriFuncs.Ops.cs +++ b/MementoMori/MementoMoriFuncs.Ops.cs @@ -2061,6 +2061,7 @@ await ExecuteQuickAction(async (log, token) => { var notReceived1 = info1.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList(); missionIds.AddRange(notReceived1); + await RewardMission(); var unfinishedIds1 = info1 .SelectMany(d => d.MissionStatusHistory) @@ -2071,6 +2072,7 @@ await ExecuteQuickAction(async (log, token) => { var notReceived2 = info2.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList(); missionIds.AddRange(notReceived2); + await RewardMission(); var unfinishedIds2 = info2 .SelectMany(d => d.MissionStatusHistory) @@ -2081,6 +2083,7 @@ await ExecuteQuickAction(async (log, token) => { var notReceived3 = info3.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList(); missionIds.AddRange(notReceived3); + await RewardMission(); } } } @@ -2088,12 +2091,23 @@ await ExecuteQuickAction(async (log, token) => { var notReceived = missionInfo.UserMissionDtoInfoDict.Values.SelectMany(d => d.SelectMany(x => x.GetNotReceivedIdList())); missionIds.AddRange(notReceived); + await RewardMission(); } } - var rewardMissionResponse = await GetResponse(new RewardMissionRequest() {TargetMissionIdList = missionIds}); - rewardMissionResponse.RewardInfo.ItemList.PrintUserItems(log); - rewardMissionResponse.RewardInfo.CharacterList.PrintCharacterDtos(log); + + async Task RewardMission() + { + if (missionIds.Count == 0) + { + return; + } + + var rewardMissionResponse = await GetResponse(new RewardMissionRequest() {TargetMissionIdList = missionIds}); + rewardMissionResponse.RewardInfo.ItemList.PrintUserItems(log); + rewardMissionResponse.RewardInfo.CharacterList.PrintCharacterDtos(log); + missionIds.Clear(); + } }); }