diff --git a/project/assets/configs/btr.json b/project/assets/configs/btr.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/project/assets/configs/btr.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/project/src/callbacks/InraidCallbacks.ts b/project/src/callbacks/InraidCallbacks.ts index 945d60be..84720d62 100644 --- a/project/src/callbacks/InraidCallbacks.ts +++ b/project/src/callbacks/InraidCallbacks.ts @@ -1,12 +1,12 @@ import { inject, injectable } from "tsyringe"; import { InraidController } from "@spt-aki/controllers/InraidController"; +import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; +import { IItemDeliveryRequestData } from "@spt-aki/models/eft/inRaid/IItemDeliveryRequestData"; import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData"; import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IItemDeliveryRequestData } from "@spt-aki/models/eft/inRaid/IItemDeliveryRequestData"; /** * Handle client requests @@ -83,6 +83,15 @@ export class InraidCallbacks return this.httpResponse.noBody(this.inraidController.getAirdropConfig()); } + /** + * Handle singleplayer/btr/config + * @returns JSON as string + */ + public getBTRConfig(): string + { + return this.httpResponse.noBody(this.inraidController.getBTRConfig()); + } + /** * Handle singleplayer/traderServices/getTraderServices */ diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index d18b33f3..c1138995 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -21,6 +21,7 @@ import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState"; import { QuestStatus } from "@spt-aki/models/enums/QuestStatus"; import { Traders } from "@spt-aki/models/enums/Traders"; 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 { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel"; @@ -44,6 +45,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export class InraidController { protected airdropConfig: IAirdropConfig; + protected btrConfig: IBTRConfig; protected inraidConfig: IInRaidConfig; protected traderConfig: ITraderConfig; @@ -71,6 +73,7 @@ export class InraidController ) { this.airdropConfig = this.configServer.getConfig(ConfigTypes.AIRDROP); + this.btrConfig = this.configServer.getConfig(ConfigTypes.BTR); this.inraidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID); this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER); } @@ -511,6 +514,15 @@ export class InraidController return this.airdropConfig; } + /** + * Get BTR config from configs/btr.json + * @returns Airdrop config + */ + public getBTRConfig(): IBTRConfig + { + return this.btrConfig; + } + /** * Handle singleplayer/traderServices/getTraderServices * @returns Trader services data diff --git a/project/src/models/enums/ConfigTypes.ts b/project/src/models/enums/ConfigTypes.ts index 3cc2aed3..928e7912 100644 --- a/project/src/models/enums/ConfigTypes.ts +++ b/project/src/models/enums/ConfigTypes.ts @@ -1,5 +1,4 @@ -export enum ConfigTypes -{ +export enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", PMC = "aki-pmc", @@ -26,4 +25,5 @@ export enum ConfigTypes SEASONAL_EVENT = "aki-seasonalevents", LOST_ON_DEATH = "aki-lostondeath", GIFTS = "aki-gifts", + BTR = "aki-btr" } diff --git a/project/src/models/spt/config/IBTRConfig.ts b/project/src/models/spt/config/IBTRConfig.ts new file mode 100644 index 00000000..d358a626 --- /dev/null +++ b/project/src/models/spt/config/IBTRConfig.ts @@ -0,0 +1,6 @@ +import { IBaseConfig } from "./IBaseConfig"; + +export interface IBTRConfig extends IBaseConfig +{ + kind: "aki-btr"; +} \ No newline at end of file diff --git a/project/src/routers/static/InraidStaticRouter.ts b/project/src/routers/static/InraidStaticRouter.ts index ac8c040c..972c96d7 100644 --- a/project/src/routers/static/InraidStaticRouter.ts +++ b/project/src/routers/static/InraidStaticRouter.ts @@ -41,6 +41,13 @@ export class InraidStaticRouter extends StaticRouter return this.inraidCallbacks.getAirdropConfig(); }, ), + new RouteAction( + "/singleplayer/btr/config", + (url: string, info: any, sessionID: string, output: string): any => + { + return this.inraidCallbacks.getBTRConfig(); + }, + ), new RouteAction( "/singleplayer/traderServices/itemDelivery", (url: string, info: any, sessionID: string, output: string): any =>