Skip to content

Commit

Permalink
Updated types to 3.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpartaPT committed Apr 29, 2024
1 parent 7ba53b8 commit 77973a1
Show file tree
Hide file tree
Showing 60 changed files with 444 additions and 125 deletions.
6 changes: 6 additions & 0 deletions types/callbacks/BotCallbacks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController";
import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class BotCallbacks {
Expand All @@ -19,6 +20,11 @@ export declare class BotCallbacks {
* @returns string
*/
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle singleplayer/settings/bot/difficulties
* @returns dictionary of every bot and its diffiulty settings
*/
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, Difficulties>;
/**
* Handle client/game/bot/generate
* @returns IGetBodyResponseData
Expand Down
5 changes: 0 additions & 5 deletions types/callbacks/InraidCallbacks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ export declare class InraidCallbacks {
* @returns JSON as string
*/
getRaidMenuSettings(): string;
/**
* Handle singleplayer/settings/weapon/durability
* @returns
*/
getWeaponDurability(): string;
/**
* Handle singleplayer/airdrop/config
* @returns JSON as string
Expand Down
6 changes: 4 additions & 2 deletions types/controllers/BotController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ export declare class BotController {
getBotCoreDifficulty(): IBotCore;
/**
* Get bot difficulty settings
* adjust PMC settings to ensure they engage the correct bot types
* Adjust PMC settings to ensure they engage the correct bot types
* @param type what bot the server is requesting settings for
* @param diffLevel difficulty level server requested settings for
* @param ignoreRaidSettings should raid settings chosen pre-raid be ignored
* @returns Difficulty object
*/
getBotDifficulty(type: string, diffLevel: string): Difficulty;
getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty;
getAllBotDifficulties(): Record<string, any>;
/**
* Generate bot profiles and store in cache
* @param sessionId Session id
Expand Down
2 changes: 1 addition & 1 deletion types/controllers/BuildController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export declare class BuildController {
saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void;
/** Handle client/builds/delete*/
removeBuild(sessionID: string, request: IRemoveBuildRequestData): void;
protected removePlayerBuild(id: string, sessionID: string): void;
protected removePlayerBuild(idToRemove: string, sessionID: string): void;
/**
* Handle client/builds/magazine/save
*/
Expand Down
8 changes: 7 additions & 1 deletion types/controllers/GameController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig";
Expand All @@ -28,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService";
import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { OpenZoneService } from "@spt-aki/services/OpenZoneService";
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
Expand All @@ -54,21 +56,25 @@ export declare class GameController {
protected itemBaseClassService: ItemBaseClassService;
protected giftService: GiftService;
protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
protected profileActivityService: ProfileActivityService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer);
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer);
load(): void;
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected adjustHideoutCraftTimes(): void;
protected adjustHideoutBuildTimes(): void;
protected adjustLocationBotValues(): void;
/**
* Out of date/incorrectly made trader mods forget this data
Expand Down
12 changes: 3 additions & 9 deletions types/controllers/HideoutController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
Expand All @@ -57,13 +58,14 @@ export declare class HideoutController {
protected hideoutHelper: HideoutHelper;
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
protected localisationService: LocalisationService;
protected profileActivityService: ProfileActivityService;
protected configServer: ConfigServer;
protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
/** Key used in TaskConditionCounters array */
protected static nameTaskConditionCountersCrafting: string;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
/**
* Handle HideoutUpgrade event
* Start a hideout area upgrade
Expand Down Expand Up @@ -222,14 +224,6 @@ export declare class HideoutController {
* @param output Output object to update
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
/**
* Start area production for item by adding production to profiles' Hideout.Production array
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get quick time event list for hideout
* // TODO - implement this
Expand Down
2 changes: 2 additions & 0 deletions types/controllers/InraidController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgre
import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
Expand Down Expand Up @@ -60,6 +61,7 @@ export declare class InraidController {
protected traderConfig: ITraderConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil);
/**
* Save locationId to active profiles inraid object AND app context
Expand Down
8 changes: 5 additions & 3 deletions types/controllers/InsuranceController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
import { InsuranceService } from "@spt-aki/services/InsuranceService";
import { MailSendService } from "@spt-aki/services/MailSendService";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
Expand All @@ -38,10 +39,11 @@ export declare class InsuranceController {
protected paymentService: PaymentService;
protected insuranceService: InsuranceService;
protected mailSendService: MailSendService;
protected ragfairPriceService: RagfairPriceService;
protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig;
protected roubleTpl: string;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
/**
* Process insurance items of all profiles prior to being given back to the player through the mail service.
*
Expand Down Expand Up @@ -145,7 +147,7 @@ export declare class InsuranceController {
*/
protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set<string>): void;
/**
* Sorts the attachment items by their max price in descending order.
* Sorts the attachment items by their dynamic price in descending order.
*
* @param attachments The array of attachments items.
* @returns An array of items enriched with their max price and common locale-name.
Expand Down Expand Up @@ -220,6 +222,6 @@ export declare class InsuranceController {
}
interface EnrichedItem extends Item {
name: string;
maxPrice: number;
dynamicPrice: number;
}
export {};
5 changes: 5 additions & 0 deletions types/controllers/LauncherController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export declare class LauncherController {
protected formatID(timeStamp: number, counter: number): string;
changeUsername(info: IChangeRequestData): string;
changePassword(info: IChangeRequestData): string;
/**
* Handle launcher requesting profile be wiped
* @param info IRegisterData
* @returns Session id
*/
wipe(info: IRegisterData): string;
getCompatibleTarkovVersion(): string;
/**
Expand Down
3 changes: 2 additions & 1 deletion types/controllers/MatchController.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ export declare class MatchController {
protected sendCoopTakenFenceMessage(sessionId: string): void;
/**
* Handle when a player extracts using a coop extract - add rep to fence
* @param sessionId Session/player id
* @param pmcData Profile
* @param extractName Name of extract taken
*/
protected handleCoopExtract(pmcData: IPmcData, extractName: string): void;
protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void;
/**
* Was extract by car
* @param extractName name of extract
Expand Down
12 changes: 6 additions & 6 deletions types/generators/BotEquipmentModGenerator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator {
*/
protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/**
* Log errors if mod is not compatible with slot
* @param modToAdd template of mod to check
* @param slotAddedToTemplate slot the item will be placed in
* @param modSlot slot the mod will fill
* @param parentTemplate template of the mods being added
* @param botRole
* Check if mod exists in db + is for a required slot
* @param modToAdd Db template of mod to check
* @param slotAddedToTemplate Slot object the item will be placed as child into
* @param modSlot Slot the mod will fill
* @param parentTemplate Db template of the mods being added
* @param botRole Bots wildspawntype (assault/pmcBot etc)
* @returns true if valid
*/
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean;
Expand Down
5 changes: 3 additions & 2 deletions types/generators/BotGenerator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
Expand Down Expand Up @@ -80,9 +80,10 @@ export declare class BotGenerator {
* @param botJsonTemplate x.json from database
* @param botGenerationDetails
* @param botRole role of bot e.g. assault
* @param sessionId profile session id
* @returns Nickname for bot
*/
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string;
protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string;
/**
* Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client
Expand Down
4 changes: 2 additions & 2 deletions types/generators/BotLootGenerator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export declare class BotLootGenerator {
* @param totalValueLimitRub Total value of loot allowed in roubles
* @param isPmc Is bot being generated for a pmc
*/
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
protected createWalletLoot(walletId: string): Item[][];
/**
* Some items need child items to function, add them to the itemToAddChildrenTo array
Expand All @@ -101,7 +101,7 @@ export declare class BotLootGenerator {
* @param botRole bots role .e.g. pmcBot
* @param isPmc are we generating for a pmc
*/
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
/**
* Hydrate item limit array to contain items that have a limit for a specific bot type
* All values are set to 0
Expand Down
Loading

0 comments on commit 77973a1

Please sign in to comment.