2023-06-11 15:10:34 +10:00
|
|
|
import { LocationGenerator } from "../generators/LocationGenerator";
|
|
|
|
import { LootGenerator } from "../generators/LootGenerator";
|
|
|
|
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
|
|
|
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
|
|
|
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
2023-10-09 20:21:00 +11:00
|
|
|
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
|
|
|
|
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
2023-06-11 15:10:34 +10:00
|
|
|
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
|
|
|
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
2023-10-09 20:21:00 +11:00
|
|
|
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
2023-06-11 15:10:34 +10:00
|
|
|
import { LootRequest } from "../models/spt/services/LootRequest";
|
|
|
|
import { ILogger } from "../models/spt/utils/ILogger";
|
|
|
|
import { ConfigServer } from "../servers/ConfigServer";
|
|
|
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
|
|
import { LocalisationService } from "../services/LocalisationService";
|
|
|
|
import { HashUtil } from "../utils/HashUtil";
|
|
|
|
import { JsonUtil } from "../utils/JsonUtil";
|
2023-10-09 20:21:00 +11:00
|
|
|
import { RandomUtil } from "../utils/RandomUtil";
|
2023-06-11 15:10:34 +10:00
|
|
|
import { TimeUtil } from "../utils/TimeUtil";
|
|
|
|
export declare class LocationController {
|
|
|
|
protected jsonUtil: JsonUtil;
|
|
|
|
protected hashUtil: HashUtil;
|
2023-10-09 20:21:00 +11:00
|
|
|
protected randomUtil: RandomUtil;
|
2023-06-11 15:10:34 +10:00
|
|
|
protected weightedRandomHelper: WeightedRandomHelper;
|
|
|
|
protected logger: ILogger;
|
|
|
|
protected locationGenerator: LocationGenerator;
|
|
|
|
protected localisationService: LocalisationService;
|
|
|
|
protected lootGenerator: LootGenerator;
|
|
|
|
protected databaseServer: DatabaseServer;
|
|
|
|
protected timeUtil: TimeUtil;
|
|
|
|
protected configServer: ConfigServer;
|
|
|
|
protected airdropConfig: IAirdropConfig;
|
2023-10-09 20:21:00 +11:00
|
|
|
protected locationConfig: ILocationConfig;
|
|
|
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
2023-06-11 15:10:34 +10:00
|
|
|
/**
|
2023-10-09 20:21:00 +11:00
|
|
|
* Handle client/location/getLocalloot
|
|
|
|
* Get a location (map) with generated loot data
|
|
|
|
* @param sessionId Player id
|
|
|
|
* @param request Map request to generate
|
|
|
|
* @returns ILocationBase
|
|
|
|
*/
|
|
|
|
get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
|
|
|
|
/**
|
|
|
|
* Generate a maps base location with loot
|
|
|
|
* @param name Map name
|
|
|
|
* @returns ILocationBase
|
|
|
|
*/
|
|
|
|
protected generate(name: string): ILocationBase;
|
|
|
|
/**
|
|
|
|
* Handle client/locations
|
2023-06-11 15:10:34 +10:00
|
|
|
* Get all maps base location properties without loot data
|
2023-10-09 20:21:00 +11:00
|
|
|
* @param sessionId Players Id
|
2023-06-11 15:10:34 +10:00
|
|
|
* @returns ILocationsGenerateAllResponse
|
|
|
|
*/
|
2023-10-09 20:21:00 +11:00
|
|
|
generateAll(sessionId: string): ILocationsGenerateAllResponse;
|
2023-06-11 15:10:34 +10:00
|
|
|
/**
|
2023-10-09 20:21:00 +11:00
|
|
|
* Handle client/location/getAirdropLoot
|
2023-06-11 15:10:34 +10:00
|
|
|
* Get loot for an airdop container
|
|
|
|
* Generates it randomly based on config/airdrop.json values
|
|
|
|
* @returns Array of LootItem objects
|
|
|
|
*/
|
2023-10-09 20:21:00 +11:00
|
|
|
getAirdropLoot(): IAirdropLootResult;
|
2023-06-11 15:10:34 +10:00
|
|
|
/**
|
|
|
|
* Randomly pick a type of airdrop loot using weighted values from config
|
|
|
|
* @returns airdrop type value
|
|
|
|
*/
|
|
|
|
protected chooseAirdropType(): AirdropTypeEnum;
|
|
|
|
/**
|
|
|
|
* Get the configuration for a specific type of airdrop
|
|
|
|
* @param airdropType Type of airdrop to get settings for
|
|
|
|
* @returns LootRequest
|
|
|
|
*/
|
|
|
|
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
|
|
|
}
|