From 429d357e89e0a1f91a69fd5b08c70ea735efa3b6 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 22 Jul 2023 13:35:49 +0100 Subject: [PATCH] Correctly parse hours into second for quest code --- project/src/controllers/QuestController.ts | 4 ++-- project/src/helpers/QuestHelper.ts | 2 +- project/src/helpers/RagfairServerHelper.ts | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index cfc93360..783a13de 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -286,7 +286,7 @@ export class QuestController MessageType.QUEST_START, messageId, startedQuestRewards, - this.questConfig.redeemTime); + this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime)); acceptQuestResponse.profileChanges[sessionID].quests = this.questHelper.acceptedUnlocked(acceptedQuest.qid, sessionID); @@ -352,7 +352,7 @@ export class QuestController MessageType.QUEST_START, questStartedMessageKey, questRewards, - this.questConfig.redeemTime); + this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime)); acceptQuestResponse.profileChanges[sessionID].quests = this.questHelper.acceptedUnlocked(acceptedQuest.qid, sessionID); return acceptQuestResponse; diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index c5e8e7e1..766e362c 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -528,7 +528,7 @@ export class QuestHelper MessageType.QUEST_FAIL, quest.failMessageText, questRewards, - this.questConfig.redeemTime + this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime) ); failedQuestResponse.profileChanges[sessionID].quests = this.failedUnlocked(failRequest.qid, sessionID); diff --git a/project/src/helpers/RagfairServerHelper.ts b/project/src/helpers/RagfairServerHelper.ts index c0648b79..3294e320 100644 --- a/project/src/helpers/RagfairServerHelper.ts +++ b/project/src/helpers/RagfairServerHelper.ts @@ -18,6 +18,7 @@ import { MailSendService } from "../services/MailSendService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { DialogueHelper } from "./DialogueHelper"; import { ItemHelper } from "./ItemHelper"; import { ProfileHelper } from "./ProfileHelper"; @@ -35,6 +36,7 @@ export class RagfairServerHelper constructor( @inject("RandomUtil") protected randomUtil: RandomUtil, @inject("HashUtil") protected hashUtil: HashUtil, + @inject("timeUtil") protected timeUtil: TimeUtil, @inject("SaveServer") protected saveServer: SaveServer, @inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("ProfileHelper") protected profileHelper: ProfileHelper, @@ -157,7 +159,7 @@ export class RagfairServerHelper MessageType.MESSAGE_WITH_ITEMS, this.localeService.getLocaleDb()[RagfairServerHelper.goodsReturnedTemplate], returnedItems, - this.questConfig.redeemTime + this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime) ); }