Made ragfair run interval time dynamic based on players current location:

Player in raid = longer time between checks (60 secs)
Player out of raid = shorter time between checks (8 secs)

Original value was 45 secs
This commit is contained in:
Dev 2024-03-17 12:27:24 +00:00
parent 95f5a49c5c
commit 2ffe44d153
4 changed files with 22 additions and 1 deletions

View File

@ -1,5 +1,9 @@
{ {
"runIntervalSeconds": 45, "runIntervalSeconds": 8,
"runIntervalValues": {
"inRaid": 60,
"outOfRaid": 8
},
"sell": { "sell": {
"fees": true, "fees": true,
"chance": { "chance": {

View File

@ -465,6 +465,9 @@ export class GameController
*/ */
public getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse 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); return this.raidTimeAdjustmentService.getRaidAdjustments(sessionId, request);
} }

View File

@ -24,6 +24,7 @@ import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig"; import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; 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 { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel"; import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -50,6 +51,7 @@ export class InraidController
protected inRaidConfig: IInRaidConfig; protected inRaidConfig: IInRaidConfig;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@ -79,6 +81,7 @@ export class InraidController
this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID); this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID);
this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER); this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER);
this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); 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); this.savePmcProgress(sessionID, offraidData);
} }
// Set flea interval time to out-of-raid value
this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.outOfRaid;
} }
/** /**

View File

@ -6,6 +6,8 @@ export interface IRagfairConfig extends IBaseConfig
kind: "aki-ragfair"; kind: "aki-ragfair";
/** How many seconds should pass before expired offers and procesed + player offers checked if sold */ /** How many seconds should pass before expired offers and procesed + player offers checked if sold */
runIntervalSeconds: number; runIntervalSeconds: number;
/** Default values used to hydrate `runIntervalSeconds` with */
runIntervalValues: IRunIntervalValues;
/** Player listing settings */ /** Player listing settings */
sell: Sell; sell: Sell;
/** Trader ids + should their assorts be listed on flea*/ /** Trader ids + should their assorts be listed on flea*/
@ -13,6 +15,12 @@ export interface IRagfairConfig extends IBaseConfig
dynamic: Dynamic; dynamic: Dynamic;
} }
export interface IRunIntervalValues
{
inRaid: number;
outOfRaid: number;
}
export interface Sell export interface Sell
{ {
/** Should a fee be deducted from player when liting an item for sale */ /** Should a fee be deducted from player when liting an item for sale */