380 #24
@ -54,7 +54,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
|
|||||||
this.traderHelper = new TraderHelper();
|
this.traderHelper = new TraderHelper();
|
||||||
this.fluentTraderAssortHeper = new FluentAssortConstructor(hashUtil, this.logger);
|
this.fluentTraderAssortHeper = new FluentAssortConstructor(hashUtil, this.logger);
|
||||||
this.traderHelper.registerProfileImage(baseJson, this.mod, preAkiModLoader, imageRouter, "cat.jpg");
|
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
|
// Add trader to trader enum
|
||||||
Traders[baseJson._id] = baseJson._id;
|
Traders[baseJson._id] = baseJson._id;
|
||||||
|
@ -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)
|
* 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 traderConfig trader config to add our trader to
|
||||||
* @param baseJson json file for trader (db/base.json)
|
* @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
|
// Add refresh time in seconds to config
|
||||||
const traderRefreshRecord: UpdateTime = {
|
const traderRefreshRecord: UpdateTime = {
|
||||||
traderId: baseJson._id,
|
traderId: baseJson._id,
|
||||||
seconds: refreshTimeSeconds };
|
seconds: {
|
||||||
|
min: refreshTimeSecondsMin,
|
||||||
|
max: refreshTimeSecondsMax
|
||||||
|
} };
|
||||||
|
|
||||||
traderConfig.updateTime.push(traderRefreshRecord);
|
traderConfig.updateTime.push(traderRefreshRecord);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user