Added IGetAirdropLootResponse

This commit is contained in:
Dev 2024-07-06 12:59:47 +01:00
parent cdcc105f6a
commit 4cf1c10c51
3 changed files with 17 additions and 3 deletions

View File

@ -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<IGetAirdropLootResponse>
{
return this.httpResponse.getBody(this.locationController.getAirdropLoot());
}

View File

@ -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`);

View File

@ -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[]
}