Skip to content

Commit

Permalink
address issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Aug 9, 2023
1 parent 264e338 commit 31ddf7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ await this.dungeonRecordService.GenerateIngameResultData(
}
);

mockQuest.State.Should().Be(0); // set to 3 in QuestService

this.mockDungeonRewardService.VerifyAll();
this.mockQuestService.VerifyAll();
this.mockUserService.VerifyAll();
Expand Down
8 changes: 7 additions & 1 deletion DragaliaAPI/Features/Quest/QuestCacheService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace DragaliaAPI.Features.Quest;

public class QuestCacheService(
IDistributedCache distributedCache,
IPlayerIdentityService playerIdentityService
IPlayerIdentityService playerIdentityService,
ILogger<QuestCacheService> logger
) : IQuestCacheService
{
private static readonly DistributedCacheEntryOptions QuestEntryCacheOptions =
Expand All @@ -31,6 +32,11 @@ await distributedCache.SetStringAsync(
return questId;
}

logger.LogError(
"Tried to parse cached quest id string {questIdString} but it was not an int",
questIdString
);

return null;
}

Expand Down
6 changes: 3 additions & 3 deletions DragaliaAPI/Features/Quest/QuestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int questId
{
if (questEventData.QuestBonusType == QuestResetIntervalType.Daily)
{
ResetQuestEventBonus(ref questEvent, ref questEventData);
ResetQuestEventBonus(questEvent, questEventData);
}

questEvent.DailyPlayCount = 0;
Expand All @@ -110,7 +110,7 @@ int questId
{
if (questEventData.QuestBonusType == QuestResetIntervalType.Weekly)
{
ResetQuestEventBonus(ref questEvent, ref questEventData);
ResetQuestEventBonus(questEvent, questEventData);
}

questEvent.WeeklyPlayCount = 0;
Expand Down Expand Up @@ -216,7 +216,7 @@ await GenerateBonusDrops(questId, count)
return new AtgenReceiveQuestBonus(questId, count, 1, bonusRewards);
}

private void ResetQuestEventBonus(ref DbQuestEvent questEvent, ref QuestEvent questEventData)
private void ResetQuestEventBonus(DbQuestEvent questEvent, QuestEvent questEventData)
{
questEvent.QuestBonusReceiveCount = 0;

Expand Down

0 comments on commit 31ddf7d

Please sign in to comment.