diff --git a/.gitignore b/.gitignore index a0dd957..e87cc57 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ **/package-lock.json **/node_modules/ **/dist/ +updateTypes.ps1 +NewTypes/ diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/TradeCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/10ScopesAndTypes/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/10ScopesAndTypes/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocation.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/IPmcData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/AccountTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ConfigTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/10ScopesAndTypes/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/10ScopesAndTypes/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/ConfigServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/ConfigServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/10ScopesAndTypes/types/utils/HashUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/HashUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/TradeCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/11BundleLoadingSample/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/11BundleLoadingSample/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocation.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocationBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/IPmcData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/AccountTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/ConfigTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/HideoutAreas.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/11BundleLoadingSample/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/11BundleLoadingSample/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/11BundleLoadingSample/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/servers/ConfigServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/ConfigServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/11BundleLoadingSample/types/utils/HashUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/HashUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/TradeCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/12ClassExtensionOverride/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocation.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocationBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IPmcData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/AccountTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/ConfigTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/HideoutAreas.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/12ClassExtensionOverride/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/12ClassExtensionOverride/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/servers/ConfigServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/ConfigServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/12ClassExtensionOverride/types/utils/HashUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/HashUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/callbacks/TradeCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/13AddTrader/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/13AddTrader/types/controllers/InraidController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/13AddTrader/types/controllers/LocationController.d.ts b/TypeScript/13AddTrader/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/13AddTrader/types/controllers/LocationController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts b/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/13AddTrader/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/13AddTrader/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/13AddTrader/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/13AddTrader/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/13AddTrader/types/models/eft/common/ILocation.d.ts b/TypeScript/13AddTrader/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/ILocationBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/13AddTrader/types/models/eft/common/IPmcData.d.ts b/TypeScript/13AddTrader/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/13AddTrader/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/13AddTrader/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/13AddTrader/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/13AddTrader/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/13AddTrader/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/13AddTrader/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/13AddTrader/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/13AddTrader/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/13AddTrader/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/13AddTrader/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/13AddTrader/types/models/enums/AccountTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/13AddTrader/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/13AddTrader/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/13AddTrader/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/13AddTrader/types/models/enums/ConfigTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/13AddTrader/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/13AddTrader/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/13AddTrader/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/13AddTrader/types/models/enums/HideoutAreas.d.ts b/TypeScript/13AddTrader/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/13AddTrader/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts b/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/13AddTrader/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/13AddTrader/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/13AddTrader/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/13AddTrader/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/13AddTrader/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/13AddTrader/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/13AddTrader/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/13AddTrader/types/servers/ConfigServer.d.ts b/TypeScript/13AddTrader/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/13AddTrader/types/servers/ConfigServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/13AddTrader/types/services/InsuranceService.d.ts +++ b/TypeScript/13AddTrader/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/services/MailSendService.d.ts b/TypeScript/13AddTrader/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/13AddTrader/types/services/MailSendService.d.ts +++ b/TypeScript/13AddTrader/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/13AddTrader/types/services/RepairService.d.ts b/TypeScript/13AddTrader/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/13AddTrader/types/services/RepairService.d.ts +++ b/TypeScript/13AddTrader/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/13AddTrader/types/utils/HashUtil.d.ts b/TypeScript/13AddTrader/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/13AddTrader/types/utils/HashUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts b/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/TradeCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/14AfterDBLoadHook/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocation.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocationBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IPmcData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/AccountTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/ConfigTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/HideoutAreas.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/14AfterDBLoadHook/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/14AfterDBLoadHook/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/servers/ConfigServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/ConfigServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/14AfterDBLoadHook/types/utils/HashUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/HashUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/15HttpListenerExample/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/callbacks/TradeCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/15HttpListenerExample/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/15HttpListenerExample/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/15HttpListenerExample/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/ILocation.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/ILocationBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/IPmcData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/AccountTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/ConfigTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/15HttpListenerExample/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/HideoutAreas.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/15HttpListenerExample/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/15HttpListenerExample/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/15HttpListenerExample/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/15HttpListenerExample/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/servers/ConfigServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/15HttpListenerExample/types/servers/ConfigServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts b/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/15HttpListenerExample/types/utils/HashUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/15HttpListenerExample/types/utils/HashUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/16ImporterUtil/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/callbacks/TradeCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/16ImporterUtil/types/controllers/PresetBuildController.d.ts b/TypeScript/16ImporterUtil/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/16ImporterUtil/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/16ImporterUtil/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/16ImporterUtil/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/16ImporterUtil/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/ILocation.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/ILocationBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/IPmcData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/16ImporterUtil/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/16ImporterUtil/types/models/enums/AccountTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/16ImporterUtil/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/16ImporterUtil/types/models/enums/ConfigTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/16ImporterUtil/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/16ImporterUtil/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/16ImporterUtil/types/models/enums/HideoutAreas.d.ts b/TypeScript/16ImporterUtil/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts b/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/16ImporterUtil/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/16ImporterUtil/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/16ImporterUtil/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/16ImporterUtil/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/16ImporterUtil/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/16ImporterUtil/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/16ImporterUtil/types/servers/ConfigServer.d.ts b/TypeScript/16ImporterUtil/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/16ImporterUtil/types/servers/ConfigServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts b/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts b/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/16ImporterUtil/types/utils/HashUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/16ImporterUtil/types/utils/HashUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TradeCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetBuildController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocation.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocationBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IPmcData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AccountTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ConfigTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/HideoutAreas.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/ConfigServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/ConfigServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/HashUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/HashUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TradeCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetBuildController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocation.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocationBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IPmcData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AccountTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ConfigTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/HideoutAreas.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/ConfigServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/ConfigServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/HashUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/HashUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/18CustomItemService/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/18CustomItemService/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/callbacks/TradeCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/18CustomItemService/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts b/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts b/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/18CustomItemService/types/controllers/PresetBuildController.d.ts b/TypeScript/18CustomItemService/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/18CustomItemService/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/18CustomItemService/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/18CustomItemService/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/18CustomItemService/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/18CustomItemService/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/ILocation.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/ILocationBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/18CustomItemService/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/IPmcData.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/18CustomItemService/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/18CustomItemService/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/18CustomItemService/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/18CustomItemService/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/18CustomItemService/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/18CustomItemService/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/18CustomItemService/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/18CustomItemService/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/18CustomItemService/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/18CustomItemService/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/18CustomItemService/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/18CustomItemService/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/18CustomItemService/types/models/enums/AccountTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/18CustomItemService/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/18CustomItemService/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/18CustomItemService/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/18CustomItemService/types/models/enums/ConfigTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/18CustomItemService/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/18CustomItemService/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/18CustomItemService/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/18CustomItemService/types/models/enums/HideoutAreas.d.ts b/TypeScript/18CustomItemService/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/18CustomItemService/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts b/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/18CustomItemService/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/18CustomItemService/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/18CustomItemService/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/18CustomItemService/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/18CustomItemService/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/18CustomItemService/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/18CustomItemService/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/18CustomItemService/types/servers/ConfigServer.d.ts b/TypeScript/18CustomItemService/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/18CustomItemService/types/servers/ConfigServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts b/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/18CustomItemService/types/services/FenceService.d.ts b/TypeScript/18CustomItemService/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/18CustomItemService/types/services/FenceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts b/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts +++ b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/18CustomItemService/types/services/RepairService.d.ts b/TypeScript/18CustomItemService/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/18CustomItemService/types/services/RepairService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/18CustomItemService/types/utils/HashUtil.d.ts b/TypeScript/18CustomItemService/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/18CustomItemService/types/utils/HashUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts b/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/callbacks/TradeCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/1LogToConsole/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/1LogToConsole/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/1LogToConsole/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/1LogToConsole/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/1LogToConsole/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/ILocation.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IPmcData.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/1LogToConsole/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/1LogToConsole/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/1LogToConsole/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/1LogToConsole/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/1LogToConsole/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/1LogToConsole/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/1LogToConsole/types/models/enums/AccountTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/1LogToConsole/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/1LogToConsole/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/1LogToConsole/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/1LogToConsole/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/1LogToConsole/types/models/enums/HideoutAreas.d.ts b/TypeScript/1LogToConsole/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/1LogToConsole/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts b/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/1LogToConsole/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/1LogToConsole/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/1LogToConsole/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/1LogToConsole/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/1LogToConsole/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/1LogToConsole/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/1LogToConsole/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/servers/ConfigServer.d.ts b/TypeScript/1LogToConsole/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/1LogToConsole/types/servers/ConfigServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/1LogToConsole/types/utils/HashUtil.d.ts b/TypeScript/1LogToConsole/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/1LogToConsole/types/utils/HashUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/callbacks/TradeCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/2EditDatabase/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts b/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/2EditDatabase/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/2EditDatabase/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/2EditDatabase/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/2EditDatabase/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/ILocation.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/ILocationBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/IPmcData.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/2EditDatabase/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/2EditDatabase/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/2EditDatabase/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/2EditDatabase/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/2EditDatabase/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/2EditDatabase/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/2EditDatabase/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/2EditDatabase/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/2EditDatabase/types/models/enums/AccountTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/2EditDatabase/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/2EditDatabase/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/2EditDatabase/types/models/enums/ConfigTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/2EditDatabase/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/2EditDatabase/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/2EditDatabase/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/2EditDatabase/types/models/enums/HideoutAreas.d.ts b/TypeScript/2EditDatabase/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/2EditDatabase/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts b/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/2EditDatabase/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/2EditDatabase/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/2EditDatabase/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/2EditDatabase/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/2EditDatabase/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/2EditDatabase/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/2EditDatabase/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/2EditDatabase/types/servers/ConfigServer.d.ts b/TypeScript/2EditDatabase/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/2EditDatabase/types/servers/ConfigServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/2EditDatabase/types/services/RepairService.d.ts b/TypeScript/2EditDatabase/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/2EditDatabase/types/services/RepairService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/2EditDatabase/types/utils/HashUtil.d.ts b/TypeScript/2EditDatabase/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/2EditDatabase/types/utils/HashUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts b/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/TradeCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/3GetSptConfigFile/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/3GetSptConfigFile/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocation.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocationBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/IPmcData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/AccountTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/ConfigTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/HideoutAreas.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/3GetSptConfigFile/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/3GetSptConfigFile/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/3GetSptConfigFile/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/servers/ConfigServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/ConfigServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/3GetSptConfigFile/types/utils/HashUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/HashUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/TradeCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/4UseACustomConfigFile/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocation.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocationBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IPmcData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/AccountTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/ConfigTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/HideoutAreas.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/4UseACustomConfigFile/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/4UseACustomConfigFile/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/servers/ConfigServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/ConfigServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/4UseACustomConfigFile/types/utils/HashUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/HashUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/TradeCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/5ReplaceMethod/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/5ReplaceMethod/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/5ReplaceMethod/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/ILocation.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/ILocationBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/IPmcData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/AccountTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/ConfigTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/5ReplaceMethod/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/HideoutAreas.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/5ReplaceMethod/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/5ReplaceMethod/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/5ReplaceMethod/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/5ReplaceMethod/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/servers/ConfigServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/5ReplaceMethod/types/servers/ConfigServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/5ReplaceMethod/types/utils/HashUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/5ReplaceMethod/types/utils/HashUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/TradeCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocation.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocationBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IPmcData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/AccountTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/ConfigTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/HideoutAreas.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/ConfigServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/ConfigServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/HashUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/HashUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/TradeCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/7OnLoadHook/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/7OnLoadHook/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/7OnLoadHook/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/ILocation.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/ILocationBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/IPmcData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/7OnLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/AccountTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/7OnLoadHook/types/models/enums/ConfigTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/7OnLoadHook/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/7OnLoadHook/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/HideoutAreas.d.ts b/TypeScript/7OnLoadHook/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/7OnLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/7OnLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/7OnLoadHook/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/7OnLoadHook/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/7OnLoadHook/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/7OnLoadHook/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/7OnLoadHook/types/servers/ConfigServer.d.ts b/TypeScript/7OnLoadHook/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/7OnLoadHook/types/servers/ConfigServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/7OnLoadHook/types/utils/HashUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/7OnLoadHook/types/utils/HashUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/TradeCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/8OnUpdateHook/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/8OnUpdateHook/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/8OnUpdateHook/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/ILocation.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/ILocationBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/IPmcData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/AccountTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/ConfigTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/8OnUpdateHook/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/HideoutAreas.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/8OnUpdateHook/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/8OnUpdateHook/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/8OnUpdateHook/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/8OnUpdateHook/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/servers/ConfigServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/8OnUpdateHook/types/servers/ConfigServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/8OnUpdateHook/types/utils/HashUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/8OnUpdateHook/types/utils/HashUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; } diff --git a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts index a182127..e9f7cf3 100644 --- a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts @@ -21,6 +21,7 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); + /** Handle "move" */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts index c022325..20d99de 100644 --- a/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts @@ -24,5 +24,7 @@ declare class LauncherCallbacks { ping(url: string, info: IEmptyRequestData, sessionID: string): string; removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string; getCompatibleTarkovVersion(): string; + getLoadedServerMods(): string; + getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } export { LauncherCallbacks }; diff --git a/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts index ca94ff4..eb1ead9 100644 --- a/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts @@ -6,11 +6,13 @@ import { INotifierChannel } from "../models/eft/notifier/INotifier"; import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class NotifierCallbacks { protected httpServerHelper: HttpServerHelper; protected httpResponse: HttpResponseUtil; + protected jsonUtil: JsonUtil; protected notifierController: NotifierController; - constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, notifierController: NotifierController); + constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController); /** * If we don't have anything to send, it's ok to not send anything back * because notification requests can be long-polling. In fact, we SHOULD wait diff --git a/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts index 541714d..e5973a9 100644 --- a/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts @@ -4,16 +4,23 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); /** Handle client/handbook/builds/my/list */ - getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle removeBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/callbacks/TradeCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/TradeCallbacks.d.ts index 8351e50..1c0cb32 100644 --- a/TypeScript/9RouterHooks/types/callbacks/TradeCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/TradeCallbacks.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; export declare class TradeCallbacks { protected tradeController: TradeController; constructor(tradeController: TradeController); @@ -12,4 +13,6 @@ export declare class TradeCallbacks { processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index bbdf519..d8f8331 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -8,6 +8,7 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { Difficulty } from "../models/eft/common/tables/IBotType"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -29,6 +30,7 @@ export declare class BotController { protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; static readonly pmcTypeLabel = "PMC"; constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** diff --git a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts index 5904c1a..d673159 100644 --- a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts @@ -7,7 +7,9 @@ import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDia import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; +import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { GiftService } from "../services/GiftService"; import { MailSendService } from "../services/MailSendService"; @@ -24,7 +26,9 @@ export declare class DialogueController { protected mailSendService: MailSendService; protected giftService: GiftService; protected hashUtil: HashUtil; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil); + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); /** Handle onUpdate spt event */ update(): void; /** diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index d7a7f1a..80d855d 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -11,21 +11,23 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { GiftService } from "../services/GiftService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { LocalisationService } from "../services/LocalisationService"; import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { EncodingUtil } from "../utils/EncodingUtil"; +import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; @@ -34,6 +36,7 @@ export declare class GameController { protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; protected randomUtil: RandomUtil; @@ -45,6 +48,7 @@ export declare class GameController { protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; @@ -53,12 +57,20 @@ export declare class GameController { protected coreConfig: ICoreConfig; protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; - protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected makeCustomsWishingTreeLootGuaranteed(): void; + protected setHideoutAreasAndCraftsTo30Secs(): void; + /** + * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated + * We store the old AID value in new field `sessionId` + * @param fullProfile Profile to update + */ + protected fixIncorrectAidValue(fullProfile: IAkiProfile): void; /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ protected adjustMapBotLimits(): void; /** diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index c8e82f0..19d341d 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -8,6 +8,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; +import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; @@ -21,6 +22,7 @@ import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgrad import { IQteData } from "../models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; @@ -76,6 +78,37 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade wall status to visible in profile if medstation/water collector are both level 1 + * @param pmcData Player profile + */ + protected checkAndUpgradeWall(pmcData: IPmcData): void; + /** + * + * @param pmcData Profile to edit + * @param output Object to send back to client + * @param sessionID Session/player id + * @param profileHideoutArea Current hideout data for profile + * @param dbHideoutArea Hideout area being upgraded + * @param hideoutStage Stage hideout area is being upgraded to + */ + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add an inventory item to profile from a hideout area stage data + * @param pmcData Profile to update + * @param dbHideoutData Hideout area from db being upgraded + * @param hideoutStage Stage area upgraded to + */ + protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + /** + * + * @param output Objet to send to client + * @param sessionID Session/player id + * @param areaType Hideout area that had stash added + * @param hideoutDbData Hideout area that caused addition of stash + * @param hideoutStage Hideout area upgraded to this + */ + protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory diff --git a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts index f224662..6e86c63 100644 --- a/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InraidController.d.ts @@ -104,10 +104,8 @@ export declare class InraidController { /** * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * @param offraidData Save Progress Request - * @param pmcData player profile - * @param isPlayerScav Was the player a pScav */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void; + protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; /** * Update profile after player completes scav raid * @param scavData Scav profile diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index ae85e96..2692121 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -56,9 +56,9 @@ export declare class InsuranceController { /** * Handle client/insurance/items/list/cost * Calculate insurance cost - * @param info request object + * @param request request object * @param sessionID session id * @returns IGetInsuranceCostResponseData object to send to client */ - cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; + cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index 3fe5b39..89909e8 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -81,25 +81,40 @@ export declare class InventoryController { */ discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; /** - * Split Item - * spliting 1 item-stack into 2 separate items ... - */ - splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; + * Split Item + * spliting 1 stack into 2 + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param request Split request + * @param sessionID Session/player id + * @returns IItemEventRouterResponse + */ + splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; /** - * Merge Item - * merges 2 items into one, deletes item from `body.item` and adding number of stacks into `body.with` + * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') + * Deletes item from `body.item` and adding number of stacks into `body.with` + * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) + * @param body Merge request + * @param sessionID Player id + * @returns IItemEventRouterResponse */ mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; /** - * Transfer item - * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" - */ + * TODO: Adds no data to output to send to client, is this by design? + * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc + * Transfer items from one stack into another while keeping original stack + * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" + * @param pmcData Player profile + * @param body Transfer request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; /** * Swap Item * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment + * Also used to swap items using quick selection on character screen */ - swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; + swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles folding of Weapons */ diff --git a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts index e8d2311..66d1f7b 100644 --- a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts @@ -1,10 +1,13 @@ import { HttpServerHelper } from "../helpers/HttpServerHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; +import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData"; import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "../models/eft/launcher/IRegisterData"; -import { Info } from "../models/eft/profile/IAkiProfile"; +import { Info, ModDetails } from "../models/eft/profile/IAkiProfile"; import { IConnectResponse } from "../models/eft/profile/IConnectResponse"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; +import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; @@ -14,11 +17,13 @@ export declare class LauncherController { protected hashUtil: HashUtil; protected saveServer: SaveServer; protected httpServerHelper: HttpServerHelper; + protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected preAkiModLoader: PreAkiModLoader; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; - constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer); + constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer); connect(): IConnectResponse; /** * Get descriptive text for each of the profile edtions a player can choose @@ -33,4 +38,15 @@ export declare class LauncherController { changePassword(info: IChangeRequestData): string; wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; + /** + * Get the mods the server has currently loaded + * @returns Dictionary of mod name and mod details + */ + getLoadedServerMods(): Record; + /** + * Get the mods a profile has ever loaded into game with + * @param sessionId Player id + * @returns Array of mod details + */ + getServerModsProfileUsed(sessionId: string): ModDetails[]; } diff --git a/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts b/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts index 156936e..94d496a 100644 --- a/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LocationController.d.ts @@ -6,6 +6,7 @@ import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSo import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { LootRequest } from "../models/spt/services/LootRequest"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -13,10 +14,12 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; +import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; export declare class LocationController { protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; + protected randomUtil: RandomUtil; protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; protected locationGenerator: LocationGenerator; @@ -26,7 +29,8 @@ export declare class LocationController { protected timeUtil: TimeUtil; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer); + 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); /** * Handle client/location/getLocalloot * Get a location (map) with generated loot data @@ -35,7 +39,7 @@ export declare class LocationController { */ get(location: string): ILocationBase; /** - * Generate a maps base location without loot + * Generate a maps base location with loot * @param name Map name * @returns ILocationBase */ diff --git a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts index 1535ee6..ce9bc7f 100644 --- a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts @@ -9,9 +9,9 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; @@ -32,7 +32,7 @@ export declare class MatchController { protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; /** Handle raid/profile/list */ diff --git a/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts index 563c5cc..d7bd3f3 100644 --- a/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/PresetBuildController.d.ts @@ -2,20 +2,35 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData"; -import { WeaponBuild } from "../models/eft/profile/IAkiProfile"; +import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData"; +import { IUserBuilds } from "../models/eft/profile/IAkiProfile"; +import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { HashUtil } from "../utils/HashUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetBuildController { + protected logger: ILogger; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected saveServer: SaveServer; - constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer); + constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer); /** Handle client/handbook/builds/my/list */ - getUserBuilds(sessionID: string): WeaponBuild[]; - /** Handle SaveBuild event */ - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - /** Handle RemoveBuild event*/ - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getUserBuilds(sessionID: string): IUserBuilds; + /** Handle SaveWeaponBuild event */ + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse; + /** Handle SaveEquipmentBuild event */ + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveWeaponBuild event*/ + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle RemoveEquipmentBuild event*/ + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts index 4dcb4b2..9c63855 100644 --- a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts @@ -71,7 +71,7 @@ export declare class RagfairController { /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data - * @param itemsToAdd + * @param itemsToAdd comes from ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns array of offers @@ -149,6 +149,13 @@ export declare class RagfairController { createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; + /** + * User requested removal of the offer, actually reduces the time to 71 seconds, + * allowing for the possibility of extending the auction before it's end time + * @param offerId offer to 'remove' + * @param sessionID Players id + * @returns IItemEventRouterResponse + */ removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts index c201791..38e9c01 100644 --- a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts @@ -1,11 +1,15 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { TradeHelper } from "../helpers/TradeHelper"; +import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Upd } from "../models/eft/common/tables/IItem"; +import { Item, Upd } from "../models/eft/common/tables/IItem"; +import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData"; import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData"; +import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData"; +import { Traders } from "../models/enums/Traders"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -13,24 +17,50 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { RagfairServer } from "../servers/RagfairServer"; import { LocalisationService } from "../services/LocalisationService"; +import { RagfairPriceService } from "../services/RagfairPriceService"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; +import { JsonUtil } from "../utils/JsonUtil"; declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected traderHelper: TraderHelper; + protected jsonUtil: JsonUtil; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle SellAllFromSavage event */ + sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Sell all sellable items to a trader from inventory + * WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD + * @param sessionId Session id + * @param profileWithItemsToSell Profile with items to be sold to trader + * @param profileThatGetsMoney Profile that gets the money after selling items + * @param trader Trader to sell items to + * @returns IItemEventRouterResponse + */ + protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse; + /** + * Looks up an items children and gets total handbook price for them + * @param parentItemId parent item that has children we want to sum price of + * @param items All items (parent + children) + * @param handbookPrices Prices of items from handbook + * @param traderDetails Trader being sold to to perform buy category check against + * @returns Rouble price + */ + protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } export { TradeController }; diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 4530517..72d2ff2 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -6,6 +6,7 @@ import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skill import { Health, IBotType } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -36,6 +37,7 @@ export declare class BotGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer); /** * Generate a player scav bot object diff --git a/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts index 63935bb..e660390 100644 --- a/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotInventoryGenerator.d.ts @@ -1,5 +1,6 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotHelper } from "../helpers/BotHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType"; @@ -25,12 +26,13 @@ export declare class BotInventoryGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; + protected itemHelper: ItemHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -103,10 +105,10 @@ export declare class BotInventoryGenerator { * @param equipmentChances Chances bot can have equipment equipped * @param botRole assault/pmcBot/bossTagilla etc * @param isPmc Is the bot being generated as a pmc - * @param itemGenerationLimitsMinMax + * @param itemGenerationWeights */ protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; } diff --git a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index 5e7df96..2dff3cc 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -2,11 +2,13 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -25,11 +27,13 @@ export declare class BotLootGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected botLootCacheService: BotLootCacheService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id @@ -46,17 +50,24 @@ export declare class BotLootGenerator { * @param botRole Role of bot (sptBear/sptUsec) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; + /** + * Get a biased random number + * @param min Smallest size + * @param max Biggest size + * @param nValue Value to bias choice + * @returns Chosen number + */ protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached - * @param pool pool of items to pick from - * @param equipmentSlots What equality slot will the loot items be added to + * @param pool Pool of items to pick from + * @param equipmentSlots What equipment slot will the loot items be added to * @param totalItemCount Max count of items to add - * @param inventoryToAddItemsTo bot inventory loot will be added to - * @param botRole role of the bot loot is being generated for (assault/pmcbot) - * @param useLimits should item limit counts be used as defined in config/bot.json - * @param totalValueLimitRub total value of loot allowed in roubles - * @param isPmc is the bot being generated for a pmc + * @param inventoryToAddItemsTo Bot inventory loot will be added to + * @param botRole Role of the bot loot is being generated for (assault/pmcbot) + * @param useLimits Should item limit counts be used as defined in config/bot.json + * @param totalValueLimitRub Total value of loot allowed in roubles + * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; /** @@ -70,38 +81,23 @@ export declare class BotLootGenerator { */ protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; /** - * @deprecated replaced by getRandomItemFromPoolByRole() * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc - * @returns ITemplateItem object - */ - protected getRandomItemFromPool(pool: ITemplateItem[], isPmc: boolean): ITemplateItem; - /** - * Get a random item from the pool parameter using the biasedRandomNumber system - * @param pool pool of items to pick an item from - * @param isPmc is the bot being created a pmc + * @param pool Pool of items to pick an item from + * @param isPmc Is the bot being created a pmc * @returns ITemplateItem object */ protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem; /** - * @deprecated Replaced by getBotLootNValueByRole() * Get the loot nvalue from botconfig - * @param isPmc if true the pmc nvalue is returned - * @returns nvalue as number - */ - protected getBotLootNValue(isPmc: boolean): number; - /** - * Get the loot nvalue from botconfig - * @param botRole role of bot e.g. assault/sptBear + * @param botRole Role of bot e.g. assault/bosstagilla/sptBear * @returns nvalue as number */ protected getBotLootNValueByRole(botRole: string): number; /** - * Update item limit array to contain items that have a limit + * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 - * @param isPmc is the bot a pmc - * @param botRole role the bot has + * @param isPmc Is the bot a pmc + * @param botRole Role the bot has * @param limitCount */ protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record): void; @@ -110,8 +106,8 @@ export declare class BotLootGenerator { * @param itemTemplate Item we check to see if its reached spawn limit * @param botRole Bot type * @param isPmc Is bot we're working with a pmc - * @param limitCount spawn limits for items on bot - * @param itemSpawnLimits the limits this bot is allowed to have + * @param limitCount Spawn limits for items on bot + * @param itemSpawnLimits The limits this bot is allowed to have * @returns true if item has reached spawn limit */ protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record, itemSpawnLimits: Record): boolean; diff --git a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts index 6c28462..ff3fb4c 100644 --- a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts @@ -2,18 +2,20 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; -import { MinMax } from "../models/common/MinMax"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; +import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; +import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { LocalisationService } from "../services/LocalisationService"; +import { RepairService } from "../services/RepairService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -33,10 +35,13 @@ export declare class BotWeaponGenerator { protected botWeaponModLimitService: BotWeaponModLimitService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected localisationService: LocalisationService; + protected repairService: RepairService; protected inventoryMagGenComponents: IInventoryMagGen[]; protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; - constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]); + protected pmcConfig: IPmcConfig; + protected repairConfig: IRepairConfig; + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]); /** * Pick a random weapon based on weightings and generate a functional weapon * @param equipmentSlot Primary/secondary/holster @@ -63,7 +68,7 @@ export declare class BotWeaponGenerator { * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod * @param botRole e.g. assault/exusec - * @param isPmc + * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; @@ -104,11 +109,11 @@ export declare class BotWeaponGenerator { * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl) - * @param magCounts Magazine count to add to inventory + * @param magWeights Magazine weights for count to add to inventory * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods diff --git a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts index d5bf61c..b8169d3 100644 --- a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts @@ -2,12 +2,15 @@ import { ContainerHelper } from "../helpers/ContainerHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; +import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation"; +import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot"; import { Item } from "../models/eft/common/tables/IItem"; -import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; +import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { JsonUtil } from "../utils/JsonUtil"; @@ -19,8 +22,15 @@ export interface IContainerItem { width: number; height: number; } +export interface IContainerGroupCount { + /** Containers this group has + probabilty to spawn */ + containerIdsWithProbability: Record; + /** How many containers the map should spawn with this group id */ + chosenCount: number; +} export declare class LocationGenerator { protected logger: ILogger; + protected databaseServer: DatabaseServer; protected jsonUtil: JsonUtil; protected objectId: ObjectId; protected randomUtil: RandomUtil; @@ -33,7 +43,38 @@ export declare class LocationGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); + /** + * Create an array of container objects with randomised loot + * @param locationBase Map base to generate containers for + * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @returns Array of container objects + */ + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + /** + * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist + * @param staticContainers + * @returns IStaticContainerData array + */ + protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[]; + /** + * Get containers with 100% spawn rate or have a type on the randomistion ignore list + * @param staticContainersOnMap + * @returns IStaticContainerData array + */ + protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; + /** + * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount + * @param containerData Containers and probability values for a groupId + * @returns List of chosen container Ids + */ + protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; + /** + * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map + * @param containersGroups Container group values + * @returns dictionary keyed by groupId + */ + protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record, staticContainersOnMap: IStaticContainerData[]): Record; /** * Choose loot to put into a static container based on weighting * Handle forced items + seasonal item removal when not in season @@ -44,7 +85,7 @@ export declare class LocationGenerator { * @param locationName Name of the map to generate static loot for * @returns IStaticContainerProps */ - generateContainerLoot(staticContainer: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; + protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerData; /** * Get a 2d grid of a containers item slots * @param containerTpl Tpl id of the container @@ -88,9 +129,10 @@ export declare class LocationGenerator { * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for * @param spawnPoint Dynamic spawn point item we want will be placed in + * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; /** * Replace the _id value for base item + all children items parentid value * @param itemWithChildren Item with mods to update diff --git a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts index 7a258df..9acff69 100644 --- a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; @@ -18,7 +18,7 @@ export declare class PMCLootGenerator { protected pocketLootPool: string[]; protected vestLootPool: string[]; protected backpackLootPool: string[]; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); /** * Create an array of loot items a PMC can have in their pockets diff --git a/TypeScript/9RouterHooks/types/generators/weapongen/InventoryMagGen.d.ts b/TypeScript/9RouterHooks/types/generators/weapongen/InventoryMagGen.d.ts index 30bf79f..f827a61 100644 --- a/TypeScript/9RouterHooks/types/generators/weapongen/InventoryMagGen.d.ts +++ b/TypeScript/9RouterHooks/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../../models/common/MinMax"; import { Inventory } from "../../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../../models/eft/common/tables/IBotType"; import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,8 +7,8 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): MinMax; + constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); + getMagCount(): GenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; diff --git a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts index df2c269..bb20955 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { Difficulty } from "../models/eft/common/tables/IBotType"; -import { IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +15,7 @@ export declare class BotDifficultyHelper { protected localisationService: LocalisationService; protected botHelper: BotHelper; protected configServer: ConfigServer; - protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** diff --git a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts index 4eec4dd..292e371 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts @@ -3,6 +3,7 @@ import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -20,6 +21,7 @@ export declare class BotGeneratorHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); /** * Adds properties to an item diff --git a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts index 3b49501..3bbdcb1 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts @@ -1,6 +1,7 @@ import { MinMax } from "../models/common/MinMax"; import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig"; +import { IPmcConfig } from "../models/spt/config/IPmcConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class BotHelper { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get a template object for the specified botRole from bots.types db @@ -70,7 +72,7 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** - * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec + * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; diff --git a/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts index a50454d..bc31d49 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,5 +1,5 @@ -import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; +import { GenerationData } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "../models/enums/EquipmentSlots"; @@ -12,6 +12,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { ContainerHelper } from "./ContainerHelper"; import { InventoryHelper } from "./InventoryHelper"; import { ItemHelper } from "./ItemHelper"; +import { WeightedRandomHelper } from "./WeightedRandomHelper"; export declare class BotWeaponGeneratorHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -19,22 +20,23 @@ export declare class BotWeaponGeneratorHelper { protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected inventoryHelper: InventoryHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected localisationService: LocalisationService; protected containerHelper: ContainerHelper; - constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); + constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** * Get a randomized number of bullets for a specific magazine - * @param magCounts min and max count of magazines + * @param magCounts Weights of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: GenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,7 +50,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index d9119a2..4b0148f 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -51,7 +51,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -181,9 +181,10 @@ export declare class HideoutHelper { * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile * @param isGeneratorOn Is the generator on for the duration of elapsed time + * @param recipe Hideout production recipe being crafted we need the ticks for * @returns Amount of time elapsed in seconds */ - protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean): number; + protected getTimeElapsedSinceLastServerTick(pmcData: IPmcData, isGeneratorOn: boolean, recipe?: IHideoutProduction): number; /** * Get a count of how many BTC can be gathered by the profile * @param pmcData Profile to look up @@ -206,6 +207,12 @@ export declare class HideoutHelper { * @returns Hideout management skill object */ protected getHideoutManagementSkill(pmcData: IPmcData): Common; + /** + * HideoutManagement skill gives a consumption bonus the higher the level + * 0.5% per level per 1-51, (25.5% at max) + * @param pmcData Profile to get hideout consumption level level from + * @returns consumption bonus + */ protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; /** * Adjust craft time based on crafting skill level found in player profile @@ -231,7 +238,7 @@ export declare class HideoutHelper { */ protected createBitcoinRequest(pmcData: IPmcData): IAddItemRequestData; /** - * Upgrade hideout wall from starting level to interactable level if enough time has passed + * Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index 7ca91f9..0157f9d 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,4 @@ -import { IPmcData } from "../models/eft/common/IPmcData"; +import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; @@ -34,7 +34,7 @@ export declare class InRaidHelper { */ removeQuestItemsOnDeath(): boolean; /** - * Check an array of items and add an upd object to money items with a stack count of 1 + * Check items array and add an upd object to money with a stack count of 1 * Single stack money items have no upd object and thus no StackObjectsCount, causing issues * @param items Items array to check */ @@ -78,7 +78,12 @@ export declare class InRaidHelper { * @param profileData player profile on server */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - protected applyTraderStandingAdjustments(preRaid: Record, postRaid: Record): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Some maps have one-time-use keys (e.g. Labs * Remove the relevant key from an inventory based on the post-raid request data passed in @@ -91,22 +96,13 @@ export declare class InRaidHelper { * @param sessionID Session id */ protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Adds SpawnedInSession property to items found in a raid - * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true - * @param preRaidProfile profile to update - * @param postRaidProfile profile to update inventory contents of - * @param isPlayerScav Was this a p scav raid - * @returns profile with FiR items properly tagged - */ - addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid * @param postRaidProfile profile to update items for * @returns Updated profile with SpawnedInSession removed */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid diff --git a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts index ff96a23..6e77109 100644 --- a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts @@ -22,7 +22,9 @@ import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; import { TraderAssortHelper } from "./TraderAssortHelper"; export interface OwnerInventoryItems { + /** Inventory items from source */ from: Item[]; + /** Inventory items at destination */ to: Item[]; sameInventory: boolean; isMail: boolean; @@ -66,8 +68,10 @@ export declare class InventoryHelper { * @param output IItemEventRouterResponse object * @param sessionID Session id * @param pmcData Profile to add ammobox to + * @param output object to send to client + * @param foundInRaid should ammo be FiR */ - protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse): void; + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, parentId: string, sessionID: string, output: IItemEventRouterResponse, foundInRaid: boolean): void; /** * * @param assortItems Items to add to inventory @@ -77,6 +81,7 @@ export declare class InventoryHelper { protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Remove item from player inventory + insured items array + * Also deletes child items * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id @@ -90,9 +95,14 @@ export declare class InventoryHelper { protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][]; /** + * Return the inventory that needs to be modified (scav/pmc etc) + * Changes made to result apply to character inventory * Based on the item action, determine whose inventories we should be looking at for from and to. + * @param request Item interaction request + * @param sessionId Session id / playerid + * @returns OwnerInventoryItems with inventory of player/scav to adjust */ - getOwnerInventoryItems(body: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionID: string): OwnerInventoryItems; + getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): OwnerInventoryItems; /** * Made a 2d array table with 0 - free slot and 1 - used slot * @param {Object} pmcData @@ -101,19 +111,36 @@ export declare class InventoryHelper { */ protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; + /** + * Get Player Stash Proper Size + * @param sessionID Playerid + * @returns Array of 2 values, x and y stash size + */ protected getPlayerStashSize(sessionID: string): Record; + /** + * Get the players stash items tpl + * @param sessionID Player id + * @returns Stash tpl + */ protected getStashType(sessionID: string): string; /** - * Internal helper function to transfer an item from one profile to another. - * fromProfileData: Profile of the source. - * toProfileData: Profile of the destination. - * body: Move request - */ + * Internal helper function to transfer an item from one profile to another. + * @param fromItems Inventory of the source (can be non-player) + * @param toItems Inventory of the destination + * @param body Move request + */ moveItemToProfile(fromItems: Item[], toItems: Item[], body: IInventoryMoveRequestData): void; /** - * Internal helper function to move item within the same profile_f. - */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): void; + * Internal helper function to move item within the same profile_f. + * @param pmcData profile to edit + * @param inventoryItems + * @param moveRequest + * @returns True if move was successful + */ + moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + success: boolean; + errorMessage?: string; + }; /** * Update fast panel bindings when an item is moved into a container that doesnt allow quick slot access * @param pmcData Player profile diff --git a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts index 8f84625..e50cae8 100644 --- a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts @@ -13,6 +13,11 @@ export declare class PresetHelper { hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getPresets(templateId: string): IPreset[]; + /** + * Get the default preset for passed in weapon id + * @param templateId Weapon id to get preset for + * @returns Null if no default preset, otherwise IPreset + */ getDefaultPreset(templateId: string): IPreset; getBaseItemTpl(presetId: string): string; } diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index 6bbaa0c..d89efeb 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -123,9 +123,10 @@ export declare class QuestHelper { * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards * @param multiplier Value to adjust money rewards by + * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ - applyMoneyBoost(quest: IQuest, multiplier: number): IQuest; + applyMoneyBoost(quest: IQuest, multiplier: number, questStatus: QuestStatus): IQuest; /** * Sets the item stack to new value, or delete the item if value <= 0 * // TODO maybe merge this function and the one from customization diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts index 9392c82..de9d550 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts @@ -51,8 +51,8 @@ export declare class RagfairOfferHelper { constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see - * @param searchRequest - * @param itemsToAdd + * @param searchRequest Data from client + * @param itemsToAdd ragfairHelper.filterCategories() * @param traderAssorts Trader assorts * @param pmcProfile Player profile * @returns Offers the player should see @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns IRagfairOffer array */ getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer is from trader standing the player does not have + * @param offer Offer to check + * @param pmcProfile Player profile + * @returns True if item is locked, false if item is purchaseable + */ + protected traderOfferLockedBehindLoyaltyLevel(offer: IRagfairOffer, pmcProfile: IPmcData): boolean; /** * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme * @param offer Offer to check is quest locked @@ -127,12 +134,12 @@ export declare class RagfairOfferHelper { protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Should a ragfair offer be visible to the player - * @param info Search request + * @param searchRequest Search request * @param itemsToAdd ? * @param traderAssorts Trader assort items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; } diff --git a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts index 8f82365..28512f1 100644 --- a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts @@ -39,12 +39,13 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData Profile to update + * @param profileWithItemsToSell Profile to remove items from + * @param profileToReceiveMoney Profile to accept the money for selling item * @param sellRequest Request data * @param sessionID Session id * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attempts to buy more than what the buy max allows diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index 7cf764d..c163f7a 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -67,10 +67,10 @@ export declare class TraderHelper { protected addStandingValuesTogether(currentStanding: number, standingToAdd: number): number; /** * Calculate traders level based on exp amount and increments level if over threshold - * @param traderID trader to process - * @param sessionID session id + * @param traderID trader to check standing of + * @param pmcData profile to update trader in */ - lvlUp(traderID: string, sessionID: string): void; + lvlUp(traderID: string, pmcData: IPmcData): void; /** * Get the next update timestamp for a trader * @param traderID Trader to look up update value for diff --git a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts index 1d3c754..c774511 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; TradingSetting: number; @@ -79,6 +80,7 @@ export interface IConfig { SkillExpPerLevel: number; GameSearchingTimeout: number; WallContusionAbsorption: Ixyz; + WeaponFastDrawSettings: IWeaponFastDrawSettings; SkillsSettings: ISkillsSettings; AzimuthPanelShowsPlayerOrientation: boolean; Aiming: IAiming; @@ -90,6 +92,19 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IWeaponFastDrawSettings { + HandShakeCurveFrequency: number; + HandShakeCurveIntensity: number; + HandShakeMaxDuration: number; + HandShakeTremorIntensity: number; + WeaponFastSwitchMaxSpeedMult: number; + WeaponFastSwitchMinSpeedMult: number; + WeaponPistolFastSwitchMaxSpeedMult: number; + WeaponPistolFastSwitchMinSpeedMult: number; +} +export interface IGraphicSettings { + ExperimentalFogInCity: boolean; +} export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; @@ -146,7 +161,11 @@ export interface IKill { expOnDamageAllHealth: number; longShotDistance: number; bloodLossToLitre: number; + botExpOnDamageAllHealth: number; + botHeadShotMult: number; victimBotLevelExp: number; + pmcExpOnDamageAllHealth: number; + pmcHeadShotMult: number; } export interface ICombo { percent: number; @@ -756,6 +775,7 @@ export interface IStamina { OverweightConsumptionByPose: Ixyz; AimingSpeedMultiplier: number; WalkVisualEffectMultiplier: number; + WeaponFastSwitchConsumption: number; HandsCapacity: number; HandsRestoration: number; ProneConsumption: number; @@ -1215,6 +1235,11 @@ export interface IFenceLevel { ScavAttackSupport: boolean; ExfiltrationPriceModifier: number; AvailableExits: number; + BotApplySilenceChance: number; + BotGetInCoverChance: number; + BotHelpChance: number; + BotSpreadoutChance: number; + BotStopChance: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/ILocation.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/ILocation.d.ts index 42fac06..f26ade6 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/ILocation.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/ILocation.d.ts @@ -3,4 +3,18 @@ import { ILooseLoot } from "./ILooseLoot"; export interface ILocation { base: ILocationBase; looseLoot: ILooseLoot; + statics: IStaticContainer; +} +export interface IStaticContainer { + containersGroups: Record; + containers: Record; +} +export interface IContainerMinMax { + minContainers: number; + maxContainers: number; + current?: number; + chosenCount?: number; +} +export interface IContainerData { + groupId: string; } diff --git a/TypeScript/9RouterHooks/types/models/eft/common/ILocationBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/ILocationBase.d.ts index f064225..5f24907 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/ILocationBase.d.ts @@ -18,6 +18,8 @@ export interface ILocationBase { BotMaxPlayer: number; BotMaxTimePlayer: number; BotNormal: number; + BotSpawnCountStep: number; + BotSpawnPeriodCheck: number; BotSpawnTimeOffMax: number; BotSpawnTimeOffMin: number; BotSpawnTimeOnMax: number; @@ -30,6 +32,7 @@ export interface ILocationBase { Enabled: boolean; EnableCoop: boolean; GlobalLootChanceModifier: number; + GlobalContainerChanceModifier: number; IconX: number; IconY: number; Id: string; @@ -47,6 +50,7 @@ export interface ILocationBase { MinPlayers: number; MaxCoopGroup: number; Name: string; + NonWaveGroupScenario: INonWaveGroupScenario; NewSpawn: boolean; OcculsionCullingEnabled: boolean; OldSpawn: boolean; @@ -85,6 +89,12 @@ export interface ILocationBase { users_summon_seconds: number; waves: Wave[]; } +export interface INonWaveGroupScenario { + Chance: number; + Enabled: boolean; + MaxToBeGroup: number; + MinToBeGroup: number; +} export interface ILimit extends MinMax { items: any[]; } @@ -207,6 +217,7 @@ export interface Wave { time_max: number; time_min: number; sptId?: string; + ChanceGroup?: number; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts index f8ea0c7..09696d4 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts @@ -16,11 +16,12 @@ export interface SpawnpointsForced { } export interface SpawnpointTemplate { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; + IsAlwaysSpawn: boolean; IsGroupPosition: boolean; GroupPositions: any[]; Root: string; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/IPmcData.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/IPmcData.d.ts index 5703e4b..4e37b60 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/IPmcData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/IPmcData.d.ts @@ -1,3 +1,7 @@ -import { IBotBase } from "./tables/IBotBase"; +import { IBotBase, IEftStats } from "./tables/IBotBase"; export interface IPmcData extends IBotBase { } +export interface IPostRaidPmcData extends IBotBase { + /** Only found in profile we get from client post raid */ + EftStats: IEftStats; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts index 69e7e00..efb6146 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts @@ -6,7 +6,9 @@ import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; export interface IBotBase { _id: string; - aid: string; + aid: number; + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ + sessionId: string; savage?: string; Info: Info; Customization: Customization; @@ -121,6 +123,8 @@ export interface Inventory { sortingTable: string; questRaidItems: string; questStashItems: string; + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ + hideoutAreaStashes: Record; fastPanel: Record; } export interface IBaseJsonSkills { @@ -146,6 +150,9 @@ export interface Common extends IBaseSkill { export interface Mastering extends IBaseSkill { } export interface Stats { + Eft: IEftStats; +} +export interface IEftStats { CarriedQuestItems: string[]; Victims: Victim[]; TotalSessionExperience: number; @@ -292,6 +299,12 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; + GivenItemsInStart?: string[]; + Interrupted?: boolean; + /** Used in hideout prodiction.json */ + needFuelForAllProductionTime?: boolean; + /** Used when sending data to client */ + NeedFuelForAllProductionTime?: boolean; sptIsScavCase?: boolean; } export interface Production extends Productive { diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts index 24b36a4..7a9fbed 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts @@ -101,18 +101,22 @@ export interface Experience { standingForKill: number; } export interface Generation { - items: ItemMinMax; + items: GenerationWeightingItems; } -export interface ItemMinMax { - grenades: MinMaxWithWhitelist; - healing: MinMaxWithWhitelist; - drugs: MinMaxWithWhitelist; - stims: MinMaxWithWhitelist; - looseLoot: MinMaxWithWhitelist; - magazines: MinMaxWithWhitelist; - specialItems: MinMaxWithWhitelist; +export interface GenerationWeightingItems { + grenades: GenerationData; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + backpackLoot: GenerationData; + pocketLoot: GenerationData; + vestLoot: GenerationData; + magazines: GenerationData; + specialItems: GenerationData; } -export interface MinMaxWithWhitelist extends MinMax { +export interface GenerationData { + /** key: number of items, value: weighting */ + weights: Record; /** Array of item tpls */ whitelist: string[]; } diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/ILootBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/ILootBase.d.ts index 8b86d13..681c32f 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/ILootBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/ILootBase.d.ts @@ -11,31 +11,30 @@ export interface IStaticAmmoDetails { } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; - staticContainers: IStaticContainerProps[]; + staticContainers: IStaticContainerData[]; staticForced: IStaticForcedProps[]; } -export interface IStaticWeaponProps { +export interface IStaticContainerData { + probability: number; + template: IStaticContainerProps; +} +export interface IStaticPropsBase { Id: string; - IsStatic: boolean; + IsContainer: boolean; useGravity: boolean; randomRotation: boolean; Position: Ixyz; Rotation: Ixyz; IsGroupPosition: boolean; + IsAlwaysSpawn: boolean; GroupPositions: any[]; Root: string; + Items: any[]; +} +export interface IStaticWeaponProps extends IStaticPropsBase { Items: Item[]; } -export interface IStaticContainerProps { - Id: string; - IsStatic: boolean; - useGravity: boolean; - randomRotation: boolean; - Position: Ixyz; - Rotation: Ixyz; - IsGroupPosition: boolean; - GroupPositions: any[]; - Root: string; +export interface IStaticContainerProps extends IStaticPropsBase { Items: StaticItem[]; } export interface StaticItem { diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IMatch.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IMatch.d.ts index c30cb48..042f5bb 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IMatch.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IMatch.d.ts @@ -7,4 +7,5 @@ export interface Metrics { RenderBins: number[]; GameUpdateBins: number[]; MemoryMeasureInterval: number; + PauseReasons: number[]; } diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts index 411fead..08280e2 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, WeaponBuild } from "../../profile/IAkiProfile"; +import { Dialogue, IUserBuilds } from "../../profile/IAkiProfile"; import { IPmcData } from "../IPmcData"; export interface IProfileTemplates { Standard: IProfileSides; @@ -14,7 +14,7 @@ export interface TemplateSide { character: IPmcData; suits: string[]; dialogues: Record; - weaponbuilds: Record; + userbuilds: IUserBuilds; trader: ProfileTraderTemplate; } export interface ProfileTraderTemplate { diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts index d8615fb..39b635b 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts @@ -9,6 +9,7 @@ export interface ITemplateItem { } export interface Props { AllowSpawnOnLocations?: any[]; + BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; SendToClient?: boolean; @@ -83,6 +84,7 @@ export interface Props { Velocity?: number; RaidModdable?: boolean; ToolModdable?: boolean; + UniqueAnimationModID?: number; BlocksFolding?: boolean; BlocksCollapsible?: boolean; IsAnimated?: boolean; @@ -106,10 +108,12 @@ export interface Props { Intensity?: number; Mask?: string; MaskSize?: number; + IsMagazineForStationaryWeapon?: boolean; NoiseIntensity?: number; NoiseScale?: number; Color?: IColor; DiffuseIntensity?: number; + MagazineWithBelt?: boolean; HasHinge?: boolean; RampPalette?: string; DepthFade?: number; @@ -212,6 +216,7 @@ export interface Props { MinRepairDegradation?: number; MaxRepairDegradation?: number; IronSightRange?: number; + IsBeltMachineGun?: boolean; IsFlareGun?: boolean; IsGrenadeLauncher?: boolean; IsOneoff?: boolean; diff --git a/TypeScript/9RouterHooks/types/models/eft/game/IGameConfigResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/IGameConfigResponse.d.ts index e1b7587..8298315 100644 --- a/TypeScript/9RouterHooks/types/models/eft/game/IGameConfigResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/game/IGameConfigResponse.d.ts @@ -6,6 +6,7 @@ export interface IGameConfigResponse { taxonomy: number; activeProfileId: string; backend: Backend; + useProtobuf: boolean; utc_time: number; /** Total in game time */ totalInGame: number; diff --git a/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutArea.d.ts index fa5ca20..bb00498 100644 --- a/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutArea.d.ts @@ -8,6 +8,7 @@ export interface IHideoutArea { craftGivesExp: boolean; displayLevel: boolean; enableAreaRequirements: boolean; + parentArea?: string; stages: Record; } export interface IAreaRequirement { @@ -19,6 +20,8 @@ export interface Stage { autoUpgrade: boolean; bonuses: StageBonus[]; constructionTime: number; + /** Containers inventory tpl */ + container?: string; description: string; displayInterface: boolean; improvements: IStageImprovement[]; @@ -67,6 +70,7 @@ export interface StageBonus { type: string; filter?: string[]; icon?: string; + /** CHANGES PER DUMP */ id?: string; templateId?: string; } diff --git a/TypeScript/9RouterHooks/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/inRaid/ISaveProgressRequestData.d.ts index fd77c32..3fdc994 100644 --- a/TypeScript/9RouterHooks/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/inRaid/ISaveProgressRequestData.d.ts @@ -1,10 +1,10 @@ import { PlayerRaidEndState } from "../../../models/enums/PlayerRaidEndState"; -import { IPmcData } from "../common/IPmcData"; +import { IPostRaidPmcData } from "../common/IPmcData"; import { ISyncHealthRequestData } from "../health/ISyncHealthRequestData"; import { IInsuredItemsData } from "./IInsuredItemsData"; export interface ISaveProgressRequestData { exit: PlayerRaidEndState; - profile: IPmcData; + profile: IPostRaidPmcData; isPlayerScav: boolean; health: ISyncHealthRequestData; insurance: IInsuredItemsData[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index 6d7c190..6d8a172 100644 --- a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -5,6 +5,7 @@ export interface To { id: string; container: string; location?: ToLocation | number; + isSearched?: boolean; } export interface ToLocation { x: number; diff --git a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryExamineRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryExamineRequestData.d.ts index 614711f..0d5f2db 100644 --- a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryExamineRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventoryExamineRequestData.d.ts @@ -1,10 +1,7 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventoryExamineRequestData extends IInventoryBaseActionRequestData { Action: "Examine"; item: string; - fromOwner: IFromOwner; -} -export interface IFromOwner { - id: string; - type: string; + fromOwner: OwnerInfo; } diff --git a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventorySplitRequestData.d.ts index 730ae71..1ba0065 100644 --- a/TypeScript/9RouterHooks/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,7 +1,11 @@ import { Container, IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; - item: string; + /** Id of item to split */ + splitItem: string; + /** Id of new item stack */ + newItem: string; + /** Destination new item will be placed in */ container: Container; count: number; } diff --git a/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index dbf6330..e4c2ab9 100644 --- a/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; @@ -20,7 +21,8 @@ export interface ProfileChange { experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; - builds: BuildChange[]; + weaponBuilds: IWeaponBuildChange[]; + equipmentBuilds: IEquipmentBuildChange[]; items: ItemChanges; production: Record; /** Hideout area improvement id */ @@ -30,8 +32,13 @@ export interface ProfileChange { traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; + changedHideoutStashes?: Record; questsStatus: QuestStatusChange[]; } +export interface IHideoutStashItem { + Id: string; + Tpl: string; +} export interface QuestStatusChange { qid: string; startTime: number; @@ -40,12 +47,21 @@ export interface QuestStatusChange { completedConditions: string[]; availableAfter: number; } -export interface BuildChange { +export interface IWeaponBuildChange { id: string; name: string; root: string; items: Item[]; } +export interface IEquipmentBuildChange { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastpanel: any[]; + buildType: EquipmentBuildType; +} export interface ItemChanges { new: Product[]; change: Product[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 42549e6..37f7ce1 100644 --- a/TypeScript/9RouterHooks/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,4 +1,4 @@ -import { Upd } from "../common/tables/IItem"; +import { Item } from "../common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; id: string; @@ -6,10 +6,3 @@ export interface IPresetBuildActionRequestData { root: string; items: Item[]; } -export interface Item { - _id: string; - _tpl: string; - upd?: Upd; - parentId?: string; - slotId?: string; -} diff --git a/TypeScript/9RouterHooks/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts new file mode 100644 index 0000000..0d61c4b --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/presetBuild/IRemoveBuildRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveBuildRequestData { + Action: "RemoveBuild"; + id: string; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts index 93b89e2..cb781c8 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts @@ -1,3 +1,4 @@ +import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType"; import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MessageType } from "../../enums/MessageType"; import { IPmcData } from "../common/IPmcData"; @@ -7,7 +8,7 @@ export interface IAkiProfile { characters: Characters; /** Clothing purchases */ suits: string[]; - weaponbuilds: Record; + userbuilds: IUserBuilds; dialogues: Record; aki: Aki; vitality: Vitality; @@ -22,6 +23,7 @@ export declare class TraderPurchaseData { } export interface Info { id: string; + aid: number; username: string; password: string; wipe: boolean; @@ -31,11 +33,25 @@ export interface Characters { pmc: IPmcData; scav: IPmcData; } -export interface WeaponBuild { +export interface IUserBuilds { + weaponBuilds: IWeaponBuild[]; + equipmentBuilds: IEquipmentBuild[]; +} +export interface IWeaponBuild { id: string; name: string; root: string; items: Item[]; + type: string; +} +export interface IEquipmentBuild { + id: string; + name: string; + root: string; + items: Item[]; + type: string; + fastPanel: Record; + buildType: EquipmentBuildType; } export interface Dialogue { attachmentsNew: number; @@ -74,7 +90,7 @@ export interface Message { Member?: IUpdatableChatMember; templateId?: string; text?: string; - hasRewards: boolean; + hasRewards?: boolean; rewardCollected: boolean; items?: MessageItems; maxStorageTime?: number; diff --git a/TypeScript/9RouterHooks/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts new file mode 100644 index 0000000..c0be040 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/trade/ISellScavItemsToFenceRequestData.d.ts @@ -0,0 +1,6 @@ +import { OwnerInfo } from "../common/request/IBaseInteractionRequestData"; +export interface ISellScavItemsToFenceRequestData { + Action: "SellAllFromSavage"; + fromOwner: OwnerInfo; + toOwner: OwnerInfo; +} diff --git a/TypeScript/9RouterHooks/types/models/enums/AccountTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/AccountTypes.d.ts new file mode 100644 index 0000000..79d74d5 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/AccountTypes.d.ts @@ -0,0 +1,3 @@ +export declare enum AccountTypes { + SPT_DEVELOPER = "spt developer" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/BackendErrorCodes.d.ts b/TypeScript/9RouterHooks/types/models/enums/BackendErrorCodes.d.ts index 6614b75..2a269b5 100644 --- a/TypeScript/9RouterHooks/types/models/enums/BackendErrorCodes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/BackendErrorCodes.d.ts @@ -6,6 +6,7 @@ export declare enum BackendErrorCodes { WRONG_AUTHORIZATION_CODE = 211, NEED_CAPTCHA = 214, NO_NEED_CAPTCHA = 215, + CAPTCHA_INVALID_ANSWER = 216, CAPTCHA_FAILED = 218, CAPTCHA_BRUTE_FORCED = 219, NO_ROOM_IN_STASH = 223, @@ -15,6 +16,7 @@ export declare enum BackendErrorCodes { REPORT_NOT_ALLOWED = 238, NICKNAME_IS_ABUSIVE = 241, NICKNAME_CHANGE_TIMEOUT = 242, + NOT_ENOUGH_SPACE_TO_UNPACK = 257, NOT_MODIFIED = 304, HTTP_BAD_REQUEST = 400, HTTP_NOT_AUTHORIZED = 401, @@ -63,5 +65,21 @@ export declare enum BackendErrorCodes { EXAMINATIONFAILED = 22001, ITEMALREADYEXAMINED = 22002, UNKNOWNNGINXERROR = 9000, - PARSERESPONSEERROR = 9001 + PARSERESPONSEERROR = 9001, + UNKNOWNMATCHMAKERERROR2 = 503000, + UNKNOWNGROUPERROR = 502000, + GROUPREQUESTNOTFOUND = 502002, + GROUPFULL = 502004, + PLAYERALREADYINGROUP = 502005, + PLAYERNOTINGROUP = 502006, + PLAYERNOTLEADER = 502007, + CANTCHANGEREADYSTATE = 502010, + PLAYERFORBIDDENGROUPINVITES = 502011, + LEADERALREADYREADY = 502012, + GROUPSENDINVITEERROR = 502013, + PLAYERISOFFLINE = 502014, + PLAYERISNOTSEARCHINGFORGROUP = 502018, + PLAYERALREADYLOOKINGFORGAME = 503001, + PLAYERINRAID = 503002, + LIMITFORPRESETSREACHED = 504001 } diff --git a/TypeScript/9RouterHooks/types/models/enums/ConfigTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/ConfigTypes.d.ts index e01425c..1ee8149 100644 --- a/TypeScript/9RouterHooks/types/models/enums/ConfigTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/ConfigTypes.d.ts @@ -1,6 +1,7 @@ export declare enum ConfigTypes { AIRDROP = "aki-airdrop", BOT = "aki-bot", + PMC = "aki-pmc", CORE = "aki-core", HEALTH = "aki-health", HIDEOUT = "aki-hideout", diff --git a/TypeScript/9RouterHooks/types/models/enums/EquipmentBuildType.d.ts b/TypeScript/9RouterHooks/types/models/enums/EquipmentBuildType.d.ts new file mode 100644 index 0000000..d98463f --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/EquipmentBuildType.d.ts @@ -0,0 +1,4 @@ +export declare enum EquipmentBuildType { + CUSTOM = 0, + STANDARD = 1 +} diff --git a/TypeScript/9RouterHooks/types/models/enums/HideoutAreas.d.ts b/TypeScript/9RouterHooks/types/models/enums/HideoutAreas.d.ts index c8313d9..1af487a 100644 --- a/TypeScript/9RouterHooks/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/HideoutAreas.d.ts @@ -23,5 +23,7 @@ export declare enum HideoutAreas { BITCOIN_FARM = 20, CHRISTMAS_TREE = 21, EMERGENCY_WALL = 22, - GYM = 23 + GYM = 23, + WEAPON_STAND = 24, + WEAPON_STAND_SECONDARY = 25 } diff --git a/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts b/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts index 94061f8..64339f1 100644 --- a/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts @@ -16,5 +16,10 @@ export declare enum ItemEventActions { DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", - HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent", + SAVE_WEAPON_BUILD = "SaveWeaponBuild", + REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", + REMOVE_BUILD = "RemoveBuild", + SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" } diff --git a/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts b/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts index 921e797..e8a2b5e 100644 --- a/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/WildSpawnTypeNumber.d.ts @@ -30,9 +30,12 @@ export declare enum WildSpawnTypeNumber { FOLLOWERBIRDEYE = 28, BOSSZRYACHIY = 29, FOLLOWERZRYACHIY = 30, - ARENAFIGHTER = 31, - ARENAFIGHTEREVENT = 32, - CRAZYASSAULTEVENT = 33, - SPTUSEC = 34, - SPTBEAR = 35 + BOSSBOAR = 32, + FOLLOWERBOAR = 33, + ARENAFIGHTER = 34, + ARENAFIGHTEREVENT = 35, + BOSSBOARSNIPER = 36, + CRAZYASSAULTEVENT = 37, + SPTUSEC = 38, + SPTBEAR = 39 } diff --git a/TypeScript/9RouterHooks/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts b/TypeScript/9RouterHooks/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts index 97c6487..4865683 100644 --- a/TypeScript/9RouterHooks/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/callbacks/IPresetBuildCallbacks.d.ts @@ -1,10 +1,12 @@ import { IPmcData } from "../../eft/common/IPmcData"; -import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; -import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { WeaponBuild } from "../../eft/profile/IAkiProfile"; +import { IItemEventRouterResponse } from "../../eft/itemEvent/IItemEventRouterResponse"; +import { IPresetBuildActionRequestData } from "../../eft/presetBuild/IPresetBuildActionRequestData"; +import { IWeaponBuild } from "../../eft/profile/IAkiProfile"; export interface IPresetBuildCallbacks { - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; - saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; - removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; + removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index 511b152..0b8f512 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -1,8 +1,7 @@ -import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { MinMax } from "../../common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; import { IBotDurability } from "./IBotDurability"; -import { IPmcConfig } from "./IPmcConfig"; export interface IBotConfig extends IBaseConfig { kind: "aki-bot"; /** How many variants of each bot should be generated on raid start */ @@ -15,8 +14,6 @@ export interface IBotConfig extends IBaseConfig { lootNValue: LootNvalue; /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ revenge: Record; - /** PMC bot specific config settings */ - pmc: IPmcConfig; /** Control how many items are allowed to spawn on a bot * key: bottype, value: */ itemSpawnLimits: Record>; @@ -26,11 +23,10 @@ export interface IBotConfig extends IBaseConfig { showTypeInNickname: boolean; /** Max number of bots that can be spawned in a raid at any one time */ maxBotCap: Record; + /** Chance scav has fake pscav name e.g. Scav name (player name) */ chanceAssaultScavHasPlayerScavName: number; /** How many stacks of secret ammo should a bot have in its bot secure container */ secureContainerAmmoStackCount: number; - /** Batch generation size when type not available in cache */ - botGenerationBatchSizePerType: number; } /** Number of bots to generate and store in cache on raid start per bot type */ export interface PresetBatch { @@ -55,6 +51,7 @@ export interface PresetBatch { followerBirdEye: number; followerBigPipe: number; followerTest: number; + followerBoar: number; marksman: number; pmcBot: number; sectantPriest: number; @@ -65,6 +62,8 @@ export interface PresetBatch { arenaFighterEvent: number; arenaFighter: number; crazyAssaultEvent: number; + bossBoar: number; + bossBoarSniper: number; sptUsec: number; sptBear: number; } @@ -102,7 +101,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomisate -ignores mods from bottype.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index d078225..4603224 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -6,6 +6,7 @@ export interface ICoreConfig extends IBaseConfig { compatibleTarkovVersion: string; serverName: string; profileSaveIntervalSeconds: number; + sptFriendNickname: string; fixes: IGameFixes; commit: string; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts index d189939..bedd941 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts @@ -3,6 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - hideoutWallAppearTimeSeconds: number; expCraftAmount: number; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 8d37f60..41b9593 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -27,6 +27,23 @@ export interface ILocationConfig extends IBaseConfig { enableBotTypeLimits: boolean; /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ botTypeLimits: Record; + /** container randomisation settings */ + containerRandomisationSettings: IContainerRandomistionSettings; + /** How full must a random loose magazine be %*/ + minFillLooseMagazinePercent: number; + /** How full must a random static magazine be %*/ + minFillStaticMagazinePercent: number; + makeWishingTreeAlwaysGiveGift: boolean; + allowDuplicateItemsInStaticContainers: boolean; +} +export interface IContainerRandomistionSettings { + enabled: boolean; + /** What maps can use the container randomisation feature */ + maps: Record; + /** Some container types don't work when randomised */ + containerTypesToNotRandomise: string[]; + containerGroupMinSizeMultiplier: number; + containerGroupMaxSizeMultiplier: number; } export interface IFixEmptyBotWavesSettings { enabled: boolean; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IPlayerScavConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IPlayerScavConfig.d.ts index 3a65e83..a10f28f 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { MinMax } from "../../common/MinMax"; +import { GenerationData } from "../../../models/eft/common/tables/IBotType"; import { IBaseConfig } from "./IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "aki-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: MinMax; - drugs: MinMax; - stims: MinMax; - looseLoot: MinMax; - magazines: MinMax; - grenades: MinMax; + healing: GenerationData; + drugs: GenerationData; + stims: GenerationData; + looseLoot: GenerationData; + magazines: GenerationData; + grenades: GenerationData; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts index 339e0c6..0f74620 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts @@ -1,6 +1,8 @@ import { MemberCategory } from "../../../models/enums/MemberCategory"; import { MinMax } from "../../common/MinMax"; -export interface IPmcConfig { +import { IBaseConfig } from "./IBaseConfig"; +export interface IPmcConfig extends IBaseConfig { + kind: "aki-pmc"; /** What game version should the PMC have */ gameVersionWeight: Record; /** What account type should the PMC have */ @@ -18,6 +20,8 @@ export interface IPmcConfig { difficulty: string; /** Chance out of 100 to have a complete gun in backpack */ looseWeaponInBackpackChancePercent: number; + /** Chance out of 100 to have an enhancement applied to PMC weapon */ + weaponHasEnhancementChancePercent: number; /** MinMax count of weapons to have in backpack */ looseWeaponInBackpackLootMinMax: MinMax; /** Percentage chance PMC will be USEC */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index be6ab91..85adf73 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -28,6 +28,10 @@ export interface FenceConfig { itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; regenerateAssortsOnRefresh: boolean; + /** Max rouble price before item is not listed on flea */ + itemCategoryRoublePriceLimit: Record; + /** Each slotid with % to be removed prior to listing on fence */ + presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; blacklist: string[]; diff --git a/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts index 582d9e2..66f9afb 100644 --- a/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/server/IDatabaseTables.d.ts @@ -1,4 +1,5 @@ import { IQteData } from "../../../models/eft/hideout/IQteData"; +import { IEquipmentBuild } from "../../../models/eft/profile/IAkiProfile"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -48,6 +49,8 @@ export interface IDatabaseTables { profiles: IProfileTemplates; /** Flea prices of items - gathered from online flea market dump */ prices: Record; + /** Default equipment loadouts that show on main inventory screen */ + defaultEquipmentPresets: IEquipmentBuild[]; }; traders?: Record; globals?: IGlobals; diff --git a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts index 9a34219..a6b003d 100644 --- a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts @@ -33,7 +33,7 @@ export declare class EventOutputHolder { */ protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; /** - * Return productions from player profile except those completed crafts the client has already seen + * Return productions from player profile except those completed crafts the client has already seen * @param pmcData Player profile * @returns dictionary of hideout productions */ diff --git a/TypeScript/9RouterHooks/types/routers/serializers/NotifySerializer.d.ts b/TypeScript/9RouterHooks/types/routers/serializers/NotifySerializer.d.ts index 0d8cc89..1d179b2 100644 --- a/TypeScript/9RouterHooks/types/routers/serializers/NotifySerializer.d.ts +++ b/TypeScript/9RouterHooks/types/routers/serializers/NotifySerializer.d.ts @@ -3,10 +3,12 @@ import { IncomingMessage, ServerResponse } from "http"; import { NotifierController } from "../../controllers/NotifierController"; import { Serializer } from "../../di/Serializer"; import { HttpServerHelper } from "../../helpers/HttpServerHelper"; +import { JsonUtil } from "../../utils/JsonUtil"; export declare class NotifySerializer extends Serializer { protected notifierController: NotifierController; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(notifierController: NotifierController, httpServerHelper: HttpServerHelper); + constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; canHandle(route: string): boolean; } diff --git a/TypeScript/9RouterHooks/types/servers/ConfigServer.d.ts b/TypeScript/9RouterHooks/types/servers/ConfigServer.d.ts index a079be8..f01be24 100644 --- a/TypeScript/9RouterHooks/types/servers/ConfigServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/ConfigServer.d.ts @@ -1,12 +1,13 @@ import { JsonUtil } from "../utils/JsonUtil"; import { VFS } from "../utils/VFS"; -import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigTypes } from "../models/enums/ConfigTypes"; +import { ILogger } from "../models/spt/utils/ILogger"; export declare class ConfigServer { protected logger: ILogger; protected vfs: VFS; protected jsonUtil: JsonUtil; protected configs: Record; + protected readonly acceptableFileExtensions: string[]; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil); getConfig(configType: ConfigTypes): T; getConfigByString(configType: string): T; diff --git a/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts index 5d40e6e..fffbea2 100644 --- a/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts @@ -6,6 +6,7 @@ import { INotification } from "../models/eft/notifier/INotifier"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { LocalisationService } from "../services/LocalisationService"; +import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; import { ConfigServer } from "./ConfigServer"; export declare class WebSocketServer { @@ -13,8 +14,9 @@ export declare class WebSocketServer { protected randomUtil: RandomUtil; protected configServer: ConfigServer; protected localisationService: LocalisationService; + protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, httpServerHelper: HttpServerHelper); + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts index eb21fd8..026d783 100644 --- a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType"; +import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -29,7 +29,7 @@ export declare class BotEquipmentFilterService { * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index 3f0e01b..dfd8820 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -44,12 +44,12 @@ export declare class FenceService { * Replace main fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceAssort(assort: ITraderAssort): void; + setFenceAssort(assort: ITraderAssort): void; /** * Replace high rep level fence assort with new assort * @param assort New assorts to replace old with */ - protected setFenceDiscountAssort(assort: ITraderAssort): void; + setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -153,6 +153,18 @@ export declare class FenceService { * @param loyaltyLevel loyalty level to requre item at */ protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; + /** + * Remove parts of a weapon prior to being listed on flea + * @param weaponAndMods Weapon to remove parts from + */ + protected removeRandomPartsOfWeapon(weaponAndMods: Item[]): void; + /** + * Roll % chance check to see if item should be removed + * @param weaponMod Weapon mod being checked + * @param itemsBeingDeleted Current list of items on weapon being deleted + * @returns True if item will be removed + */ + protected presetModItemWillBeRemoved(weaponMod: Item, itemsBeingDeleted: string[]): boolean; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts index 5354cc0..69bf0e4 100644 --- a/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/InsuranceService.d.ts @@ -2,7 +2,6 @@ import { ITraderBase } from "../models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; -import { NotificationSendHelper } from "../helpers/NotificationSendHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; @@ -19,6 +18,7 @@ import { RandomUtil } from "../utils/RandomUtil"; import { TimeUtil } from "../utils/TimeUtil"; import { LocaleService } from "./LocaleService"; import { LocalisationService } from "./LocalisationService"; +import { MailSendService } from "./MailSendService"; export declare class InsuranceService { protected logger: ILogger; protected databaseServer: DatabaseServer; @@ -33,11 +33,11 @@ export declare class InsuranceService { protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; protected localeService: LocaleService; - protected notificationSendHelper: NotificationSendHelper; + protected mailSendService: MailSendService; protected configServer: ConfigServer; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, notificationSendHelper: NotificationSendHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer); /** * Does player have insurance array * @param sessionId Player id @@ -67,9 +67,10 @@ export declare class InsuranceService { sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Send a message to player informing them gear was lost - * @param sessionID Session id + * @param sessionId Session id + * @param locationName name of map insurance was lost on */ - sendLostInsuranceMessage(sessionID: string): void; + sendLostInsuranceMessage(sessionId: string, locationName?: string): void; /** * Check all root insured items and remove location property + set slotId to 'hideout' * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts index 8ec5cf8..19397dc 100644 --- a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts @@ -45,7 +45,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; /** * Send a message from SYSTEM to the player with or without items * @param playerId Players id to send message to @@ -54,6 +54,14 @@ export declare class MailSendService { * @param maxStorageTimeSeconds Optional time to collect items before they expire */ sendSystemMessageToPlayer(playerId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; + /** + * Send a message from SYSTEM to the player with or without items with loalised text + * @param playerId Players id to send message to + * @param messageLocaleId Id of key from locale file to send to player + * @param items Optional items to send to player + * @param maxStorageTimeSeconds Optional time to collect items before they expire + */ + sendLocalisedSystemMessageToPlayer(playerId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param playerId Players id to send message to diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index b92c2f0..14f4e22 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -35,6 +35,9 @@ export declare class ProfileFixerService { * @param pmcProfile profile to check and fix */ checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; + protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; + protected addHideoutAreaStashes(pmcProfile: IPmcData): void; + protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected adjustUnreasonableModFleaPrices(): void; /** * Add tag to profile to indicate when it was made diff --git a/TypeScript/9RouterHooks/types/services/RepairService.d.ts b/TypeScript/9RouterHooks/types/services/RepairService.d.ts index 2f7d1db..2fd22ed 100644 --- a/TypeScript/9RouterHooks/types/services/RepairService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RepairService.d.ts @@ -94,11 +94,11 @@ export declare class RepairService { */ addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; /** - * Add buff to item + * Add random buff to item * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + addBuff(itemConfig: BonusSettings, item: Item): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/TypeScript/9RouterHooks/types/utils/HashUtil.d.ts b/TypeScript/9RouterHooks/types/utils/HashUtil.d.ts index a8500e1..c017ca8 100644 --- a/TypeScript/9RouterHooks/types/utils/HashUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/HashUtil.d.ts @@ -18,4 +18,5 @@ export declare class HashUtil { * @returns hash value */ generateHashForData(algorithm: string, data: crypto.BinaryLike): string; + generateAccountId(): number; } diff --git a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts index 3a78618..70282ab 100644 --- a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts @@ -9,6 +9,11 @@ export declare class HttpResponseUtil { protected localisationService: LocalisationService; constructor(jsonUtil: JsonUtil, localisationService: LocalisationService); protected clearString(s: string): any; + /** + * Return passed in data as JSON string + * @param data + * @returns + */ noBody(data: any): any; getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; diff --git a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts index 229dc26..732c15d 100644 --- a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts @@ -1,3 +1,4 @@ +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "../models/spt/utils/ILogger"; import { HashUtil } from "./HashUtil"; import { VFS } from "./VFS"; @@ -7,21 +8,68 @@ export declare class JsonUtil { protected logger: ILogger; protected fileHashes: any; protected jsonCacheExists: boolean; + protected jsonCachePath: string; constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger); /** * From object to string * @param data object to turn into JSON - * @param prettify Should output be prettified? + * @param prettify Should output be prettified * @returns string */ - serialize(data: T, prettify?: boolean): string; + serialize(data: any, prettify?: boolean): string; + /** + * From object to string + * @param data object to turn into JSON + * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns string + */ + serializeAdvanced(data: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; + /** + * From object to string + * @param data object to turn into JSON + * @param filename Name of file being serialized + * @param options Stringify options or a replacer. + * @returns The string converted from the JavaScript value + */ + serializeJsonC(data: any, filename?: string | null, options?: IStringifyOptions | Reviver): string; /** * From string to object * @param jsonString json string to turn into object + * @param filename Name of file being deserialized * @returns object */ deserialize(jsonString: string, filename?: string): T; + /** + * From string to object + * @param jsonString json string to turn into object + * @param filename Name of file being deserialized + * @param options Parsing options + * @returns object + */ + deserializeJsonC(jsonString: string, filename?: string, options?: IParseOptions): T; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; + /** + * From json string to object + * @param jsonString String to turn into object + * @param filePath Path to json file being processed + * @returns Object + */ deserializeWithCacheCheck(jsonString: string, filePath: string): T; - clone(data: T): T; + /** + * Create file if nothing found + * @param jsonCachePath path to cache + */ + protected ensureJsonCacheExists(jsonCachePath: string): void; + /** + * Read contents of json cache and add to class field + * @param jsonCachePath Path to cache + */ + protected hydrateJsonCache(jsonCachePath: string): void; + /** + * Convert into string and back into object to clone object + * @param objectToClone Item to clone + * @returns Cloned parameter + */ + clone(objectToClone: T): T; } diff --git a/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts b/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts index 806071f..92c37da 100644 --- a/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/RandomUtil.d.ts @@ -18,7 +18,8 @@ import { MathUtil } from "./MathUtil"; */ export declare class ProbabilityObjectArray extends Array> { private mathUtil; - constructor(mathUtil: MathUtil, ...items: ProbabilityObject[]); + private jsonUtil; + constructor(mathUtil: MathUtil, jsonUtil: JsonUtil, ...items: ProbabilityObject[]); filter(callbackfn: (value: ProbabilityObject, index: number, array: ProbabilityObject[]) => any): ProbabilityObjectArray; /** * Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1 @@ -78,11 +79,10 @@ export declare class ProbabilityObjectArray extends Array): K[]; }