From 4cf1c10c51602f40c3ecaded90e706c3e6766ee7 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 6 Jul 2024 12:59:47 +0100 Subject: [PATCH] Added `IGetAirdropLootResponse` --- project/src/callbacks/LocationCallbacks.ts | 7 ++++++- project/src/controllers/LocationController.ts | 4 ++-- .../src/models/eft/location/IGetAirdropLootResponse.ts | 9 +++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 project/src/models/eft/location/IGetAirdropLootResponse.ts diff --git a/project/src/callbacks/LocationCallbacks.ts b/project/src/callbacks/LocationCallbacks.ts index cfbccffa..184bf601 100644 --- a/project/src/callbacks/LocationCallbacks.ts +++ b/project/src/callbacks/LocationCallbacks.ts @@ -4,6 +4,7 @@ import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; @@ -37,7 +38,11 @@ export class LocationCallbacks } /** Handle client/airdrop/loot */ - public getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): any + public getAirdropLoot( + url: string, + info: IEmptyRequestData, + sessionID: string, + ): IGetBodyResponseData { return this.httpResponse.getBody(this.locationController.getAirdropLoot()); } diff --git a/project/src/controllers/LocationController.ts b/project/src/controllers/LocationController.ts index f9826c98..a443e298 100644 --- a/project/src/controllers/LocationController.ts +++ b/project/src/controllers/LocationController.ts @@ -7,7 +7,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; import { ILooseLoot, SpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; -import { IAirdropLootResult } from "@spt/models/eft/location/IAirdropLootResult"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; @@ -171,7 +171,7 @@ export class LocationController * Generates it randomly based on config/airdrop.json values * @returns Array of LootItem objects */ - public getAirdropLoot(): any // TODO: need to fix + public getAirdropLoot(): IGetAirdropLootResponse { const airdropType = this.chooseAirdropType(); this.logger.debug(`Chose ${airdropType} for airdrop loot`); diff --git a/project/src/models/eft/location/IGetAirdropLootResponse.ts b/project/src/models/eft/location/IGetAirdropLootResponse.ts new file mode 100644 index 00000000..1e8f1ae9 --- /dev/null +++ b/project/src/models/eft/location/IGetAirdropLootResponse.ts @@ -0,0 +1,9 @@ +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; + +export interface IGetAirdropLootResponse +{ + // The type of airdrop + icon: AirdropTypeEnum + container: Item[] +}