From d4fc5a2903ce43c382f66e8875941f056609e74c Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 17 Mar 2024 15:42:46 +0000 Subject: [PATCH] Update add trader mod --- TypeScript/13AddTrader/src/mod.ts | 2 +- TypeScript/13AddTrader/src/traderHelpers.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/TypeScript/13AddTrader/src/mod.ts b/TypeScript/13AddTrader/src/mod.ts index 2608d2a..5958d71 100644 --- a/TypeScript/13AddTrader/src/mod.ts +++ b/TypeScript/13AddTrader/src/mod.ts @@ -54,7 +54,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod this.traderHelper = new TraderHelper(); this.fluentTraderAssortHeper = new FluentAssortConstructor(hashUtil, this.logger); this.traderHelper.registerProfileImage(baseJson, this.mod, preAkiModLoader, imageRouter, "cat.jpg"); - this.traderHelper.setTraderUpdateTime(traderConfig, baseJson, 3600); + this.traderHelper.setTraderUpdateTime(traderConfig, baseJson, 3600, 4000); // Add trader to trader enum Traders[baseJson._id] = baseJson._id; diff --git a/TypeScript/13AddTrader/src/traderHelpers.ts b/TypeScript/13AddTrader/src/traderHelpers.ts index 31b6d1b..eacbffd 100644 --- a/TypeScript/13AddTrader/src/traderHelpers.ts +++ b/TypeScript/13AddTrader/src/traderHelpers.ts @@ -28,14 +28,18 @@ export class TraderHelper * Add record to trader config to set the refresh time of trader in seconds (default is 60 minutes) * @param traderConfig trader config to add our trader to * @param baseJson json file for trader (db/base.json) - * @param refreshTimeSeconds How many sections between trader stock refresh + * @param refreshTimeSecondsMin How many seconds between trader stock refresh min time + * @param refreshTimeSecondsMax How many seconds between trader stock refresh max time */ - public setTraderUpdateTime(traderConfig: ITraderConfig, baseJson: any, refreshTimeSeconds: number): void + public setTraderUpdateTime(traderConfig: ITraderConfig, baseJson: any, refreshTimeSecondsMin: number, refreshTimeSecondsMax: number): void { // Add refresh time in seconds to config const traderRefreshRecord: UpdateTime = { traderId: baseJson._id, - seconds: refreshTimeSeconds }; + seconds: { + min: refreshTimeSecondsMin, + max: refreshTimeSecondsMax + } }; traderConfig.updateTime.push(traderRefreshRecord); }