diff --git a/project/assets/configs/ragfair.json b/project/assets/configs/ragfair.json index 621cc410..e2ef03de 100644 --- a/project/assets/configs/ragfair.json +++ b/project/assets/configs/ragfair.json @@ -1,5 +1,9 @@ { - "runIntervalSeconds": 45, + "runIntervalSeconds": 8, + "runIntervalValues": { + "inRaid": 60, + "outOfRaid": 8 + }, "sell": { "fees": true, "chance": { diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index 24b3e60e..29552c09 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -465,6 +465,9 @@ export class GameController */ public getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse { + // Set flea interval time to in-raid value + this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.inRaid; + return this.raidTimeAdjustmentService.getRaidAdjustments(sessionId, request); } diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index e474ed12..1144bdf6 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -24,6 +24,7 @@ import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig"; import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -50,6 +51,7 @@ export class InraidController protected inRaidConfig: IInRaidConfig; protected traderConfig: ITraderConfig; protected locationConfig: ILocationConfig; + protected ragfairConfig: IRagfairConfig; constructor( @inject("WinstonLogger") protected logger: ILogger, @@ -79,6 +81,7 @@ export class InraidController this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID); this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER); this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); + this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR); } /** @@ -116,6 +119,9 @@ export class InraidController { this.savePmcProgress(sessionID, offraidData); } + + // Set flea interval time to out-of-raid value + this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.outOfRaid; } /** diff --git a/project/src/models/spt/config/IRagfairConfig.ts b/project/src/models/spt/config/IRagfairConfig.ts index 7ebc081f..cde750cc 100644 --- a/project/src/models/spt/config/IRagfairConfig.ts +++ b/project/src/models/spt/config/IRagfairConfig.ts @@ -6,6 +6,8 @@ export interface IRagfairConfig extends IBaseConfig kind: "aki-ragfair"; /** How many seconds should pass before expired offers and procesed + player offers checked if sold */ runIntervalSeconds: number; + /** Default values used to hydrate `runIntervalSeconds` with */ + runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; /** Trader ids + should their assorts be listed on flea*/ @@ -13,6 +15,12 @@ export interface IRagfairConfig extends IBaseConfig dynamic: Dynamic; } +export interface IRunIntervalValues +{ + inRaid: number; + outOfRaid: number; +} + export interface Sell { /** Should a fee be deducted from player when liting an item for sale */