From 121387aa697d5ef7303bcce334d8ca48be25a748 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 9 Jul 2024 14:51:57 +0100 Subject: [PATCH] Deleted unused endpoints + code --- project/src/callbacks/InraidCallbacks.ts | 18 -------------- project/src/controllers/InraidController.ts | 24 ------------------- project/src/models/enums/ConfigTypes.ts | 1 - .../src/models/spt/config/IAirdropConfig.ts | 17 ------------- project/src/models/spt/config/IBTRConfig.ts | 15 ------------ .../src/routers/static/InraidStaticRouter.ts | 14 ----------- 6 files changed, 89 deletions(-) delete mode 100644 project/src/models/spt/config/IBTRConfig.ts diff --git a/project/src/callbacks/InraidCallbacks.ts b/project/src/callbacks/InraidCallbacks.ts index cc58fb6d..eb859f37 100644 --- a/project/src/callbacks/InraidCallbacks.ts +++ b/project/src/callbacks/InraidCallbacks.ts @@ -64,24 +64,6 @@ export class InraidCallbacks return this.httpResponse.noBody(this.inraidController.getInraidConfig().raidMenuSettings); } - /** - * Handle singleplayer/airdrop/config - * @returns JSON as string - */ - public getAirdropConfig(): string - { - 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()); - } - public getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string { return this.httpResponse.noBody(this.inraidController.getTraitorScavHostileChance(url, sessionId)); diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index e314b82b..43a52b31 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -19,9 +19,7 @@ import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { Traders } from "@spt/models/enums/Traders"; -import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; -import { IBTRConfig } from "@spt/models/spt/config/IBTRConfig"; import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; @@ -45,8 +43,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; @injectable() export class InraidController { - protected airdropConfig: IAirdropConfig; - protected btrConfig: IBTRConfig; protected inRaidConfig: IInRaidConfig; protected traderConfig: ITraderConfig; protected locationConfig: ILocationConfig; @@ -76,8 +72,6 @@ export class InraidController @inject("RandomUtil") protected randomUtil: RandomUtil, ) { - 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); this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); @@ -630,24 +624,6 @@ export class InraidController return this.inRaidConfig; } - /** - * Get airdrop config from configs/airdrop.json - * @returns Airdrop config - */ - public getAirdropConfig(): IAirdropConfig - { - return this.airdropConfig; - } - - /** - * Get BTR config from configs/btr.json - * @returns Airdrop config - */ - public getBTRConfig(): IBTRConfig - { - return this.btrConfig; - } - public getTraitorScavHostileChance(url: string, sessionID: string): number { return this.inRaidConfig.playerScavHostileChancePercent; diff --git a/project/src/models/enums/ConfigTypes.ts b/project/src/models/enums/ConfigTypes.ts index 351117aa..a229758e 100644 --- a/project/src/models/enums/ConfigTypes.ts +++ b/project/src/models/enums/ConfigTypes.ts @@ -26,5 +26,4 @@ export enum ConfigTypes SEASONAL_EVENT = "spt-seasonalevents", LOST_ON_DEATH = "spt-lostondeath", GIFTS = "spt-gifts", - BTR = "spt-btr", } diff --git a/project/src/models/spt/config/IAirdropConfig.ts b/project/src/models/spt/config/IAirdropConfig.ts index e48f7dcd..5759a606 100644 --- a/project/src/models/spt/config/IAirdropConfig.ts +++ b/project/src/models/spt/config/IAirdropConfig.ts @@ -5,24 +5,7 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IAirdropConfig extends IBaseConfig { kind: "spt-airdrop" - airdropChancePercent: AirdropChancePercent airdropTypeWeightings: Record - /** Lowest point plane will fly at */ - planeMinFlyHeight: number - /** Highest point plane will fly at */ - planeMaxFlyHeight: number - /** Loudness of plane engine */ - planeVolume: number - /** Speed plane flies overhead */ - planeSpeed: number - /** Speed loot crate falls after being dropped */ - crateFallSpeed: number - /** Container tpls to use when spawning crate - affects container size, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ - containerIds: Record - /** Earliest time aircraft will spawn in raid */ - airdropMinStartTimeSeconds: number - /** Latest time aircraft will spawn in raid */ - airdropMaxStartTimeSeconds: number /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ loot: Record } diff --git a/project/src/models/spt/config/IBTRConfig.ts b/project/src/models/spt/config/IBTRConfig.ts deleted file mode 100644 index 393982ed..00000000 --- a/project/src/models/spt/config/IBTRConfig.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; - -export interface IBTRConfig extends IBaseConfig -{ - kind: "spt-btr" - /** How fast the BTR moves */ - moveSpeed: number - /** How long the cover fire service lasts for */ - coverFireTime: number - /** How long the BTR waits at every point in its path */ - pointWaitTime: MinMax - /** How long after purchasing the taxi service before the BTR leaves */ - taxiWaitTime: number -} diff --git a/project/src/routers/static/InraidStaticRouter.ts b/project/src/routers/static/InraidStaticRouter.ts index d9d7931b..5193fd38 100644 --- a/project/src/routers/static/InraidStaticRouter.ts +++ b/project/src/routers/static/InraidStaticRouter.ts @@ -30,20 +30,6 @@ export class InraidStaticRouter extends StaticRouter return this.inraidCallbacks.getRaidMenuSettings(); }, ), - new RouteAction( - "/singleplayer/airdrop/config", - async (url: string, info: any, sessionID: string, output: string): Promise => - { - return this.inraidCallbacks.getAirdropConfig(); - }, - ), - new RouteAction( - "/singleplayer/btr/config", - async (url: string, info: any, sessionID: string, output: string): Promise => - { - return this.inraidCallbacks.getBTRConfig(); - }, - ), new RouteAction( "/singleplayer/scav/traitorscavhostile", async (url: string, info: any, sessionID: string, output: string): Promise =>