Added variable hideout update() check times when in and out of raid

This commit is contained in:
Dev 2024-03-30 15:15:06 +00:00
parent df939c693f
commit c05347279b
6 changed files with 26 additions and 10 deletions

View File

@ -1,5 +1,9 @@
{ {
"runIntervalSeconds": 15, "runIntervalSeconds": 10,
"hoursForSkillCrafting": 28800, "hoursForSkillCrafting": 28800,
"runIntervalValues": {
"inRaid": 60,
"outOfRaid": 10
},
"expCraftAmount": 10 "expCraftAmount": 10
} }

View File

@ -25,6 +25,7 @@ import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
import { Traders } from "@spt-aki/models/enums/Traders"; import { Traders } from "@spt-aki/models/enums/Traders";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig"; import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig";
@ -53,6 +54,7 @@ export class GameController
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig; protected lootConfig: ILootConfig;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
@ -84,6 +86,7 @@ export class GameController
this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE); this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE);
this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION);
this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR); this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
this.pmcConfig = this.configServer.getConfig(ConfigTypes.PMC); this.pmcConfig = this.configServer.getConfig(ConfigTypes.PMC);
this.lootConfig = this.configServer.getConfig(ConfigTypes.LOOT); this.lootConfig = this.configServer.getConfig(ConfigTypes.LOOT);
this.botConfig = this.configServer.getConfig(ConfigTypes.BOT); this.botConfig = this.configServer.getConfig(ConfigTypes.BOT);
@ -465,9 +468,11 @@ 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 // Set interval times to in-raid value
this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.inRaid; this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.inRaid;
this.hideoutConfig.runIntervalSeconds = this.hideoutConfig.runIntervalValues.inRaid;
return this.raidTimeAdjustmentService.getRaidAdjustments(sessionId, request); return this.raidTimeAdjustmentService.getRaidAdjustments(sessionId, request);
} }

View File

@ -23,6 +23,7 @@ import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
import { Traders } from "@spt-aki/models/enums/Traders"; import { Traders } from "@spt-aki/models/enums/Traders";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig"; 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 { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
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 { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
@ -53,6 +54,7 @@ export class InraidController
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@ -83,6 +85,7 @@ export class InraidController
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); this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
} }
/** /**
@ -123,6 +126,7 @@ export class InraidController
// Set flea interval time to out-of-raid value // Set flea interval time to out-of-raid value
this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.outOfRaid; this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.outOfRaid;
this.hideoutConfig.runIntervalSeconds = this.hideoutConfig.runIntervalValues.outOfRaid;
} }
/** /**

View File

@ -2,3 +2,9 @@ export interface IBaseConfig
{ {
kind: string; kind: string;
} }
export interface IRunIntervalValues
{
inRaid: number;
outOfRaid: number;
}

View File

@ -1,9 +1,12 @@
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; import { IBaseConfig, IRunIntervalValues } from "@spt-aki/models/spt/config/IBaseConfig";
export interface IHideoutConfig extends IBaseConfig export interface IHideoutConfig extends IBaseConfig
{ {
kind: "aki-hideout"; kind: "aki-hideout";
/** How many seconds should pass before hideout crafts / fuel usage is checked and procesed */
runIntervalSeconds: number; runIntervalSeconds: number;
/** Default values used to hydrate `runIntervalSeconds` with */
runIntervalValues: IRunIntervalValues;
hoursForSkillCrafting: number; hoursForSkillCrafting: number;
expCraftAmount: number; expCraftAmount: number;
} }

View File

@ -1,5 +1,5 @@
import { MinMax } from "@spt-aki/models/common/MinMax"; import { MinMax } from "@spt-aki/models/common/MinMax";
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; import { IBaseConfig, IRunIntervalValues } from "@spt-aki/models/spt/config/IBaseConfig";
export interface IRagfairConfig extends IBaseConfig export interface IRagfairConfig extends IBaseConfig
{ {
@ -15,12 +15,6 @@ 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 */