From daeae9687ad809726377ae04658526c1ad67f798 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 5 Jul 2024 16:37:17 +0100 Subject: [PATCH 1/3] Fixed `getLocation()` not getting location correctly (cherry picked from commit d7798d3afa8028fffb13eb3970062f5ffae9fc6d) --- project/src/services/DatabaseService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/services/DatabaseService.ts b/project/src/services/DatabaseService.ts index fcaa1e8a..bc427781 100644 --- a/project/src/services/DatabaseService.ts +++ b/project/src/services/DatabaseService.ts @@ -116,7 +116,7 @@ export class DatabaseService public getLocation(locationId: string): ILocation { const locations = this.getLocations(); - const desiredLocation = locations[locationId]; + const desiredLocation = locations[locationId.toLowerCase()]; if (!desiredLocation) { throw new Error(this.localisationService.getText("database-no_location_found_with_id", locationId)); From 541264af737ecdcbb6fa182faf7f1a4356328150 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 5 Jul 2024 16:39:40 +0100 Subject: [PATCH 2/3] Fixed bad description (cherry picked from commit 2f6f09c51a36beacbe9a3ede4fb21a4ac3e01b80) --- project/src/services/DatabaseService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/services/DatabaseService.ts b/project/src/services/DatabaseService.ts index bc427781..92607dc9 100644 --- a/project/src/services/DatabaseService.ts +++ b/project/src/services/DatabaseService.ts @@ -110,7 +110,7 @@ export class DatabaseService /** * Get specific location by its Id - * @param locationId Desired trader id + * @param locationId Desired location id * @returns assets/database/locations/ */ public getLocation(locationId: string): ILocation From 4b2f42a406c4d27bdf334017c96b9f93a9e11edd Mon Sep 17 00:00:00 2001 From: Kaeno Date: Fri, 5 Jul 2024 16:46:51 +0000 Subject: [PATCH 3/3] Add routes for Modules to get Bosses that are allowed to be converted (!368) Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/368 --- project/src/callbacks/InraidCallbacks.ts | 5 +++++ project/src/controllers/InraidController.ts | 8 ++++++++ project/src/routers/static/InraidStaticRouter.ts | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/project/src/callbacks/InraidCallbacks.ts b/project/src/callbacks/InraidCallbacks.ts index 12466fad..1ac4ab4a 100644 --- a/project/src/callbacks/InraidCallbacks.ts +++ b/project/src/callbacks/InraidCallbacks.ts @@ -110,4 +110,9 @@ export class InraidCallbacks { return this.httpResponse.noBody(this.inraidController.getSandboxMaxPatrolValue(url, sessionId)); } + + public getBossConvertSettings(url: string, info: IEmptyRequestData, sessionId: string): string + { + return this.httpResponse.noBody(this.inraidController.getBossConvertSettings(url, sessionId)) + } } diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index 43daf162..7edbe8bf 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -41,6 +41,7 @@ import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; import { TraderServicesService } from "@spt/services/TraderServicesService"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; /** * Logic for handling In Raid callbacks @@ -55,6 +56,7 @@ export class InraidController protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; + protected botConfig: IBotConfig; constructor( @inject("PrimaryLogger") protected logger: ILogger, @@ -86,6 +88,7 @@ export class InraidController this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR); this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT); + this.botConfig = this.configServer.getConfig(ConfigTypes.BOT); } /** @@ -712,4 +715,9 @@ export class InraidController { return this.locationConfig.sandboxMaxPatrolvalue; } + + public getBossConvertSettings(url: string, sessionId: string): string[] + { + return Object.keys(this.botConfig.assaultToBossConversion.bossesToConvertToWeights); + } } diff --git a/project/src/routers/static/InraidStaticRouter.ts b/project/src/routers/static/InraidStaticRouter.ts index 0bf08cd5..36cc371f 100644 --- a/project/src/routers/static/InraidStaticRouter.ts +++ b/project/src/routers/static/InraidStaticRouter.ts @@ -65,6 +65,13 @@ export class InraidStaticRouter extends StaticRouter return this.inraidCallbacks.getSandboxMaxPatrolValue(url, info, sessionID); }, ), + new RouteAction( + "/singleplayer/BossConvert", + async (url: string, info: any, sessionID: string, output: string): Promise => + { + return this.inraidCallbacks.getBossConvertSettings(url, info, sessionID); + }, + ), ]); } }